System.InvalidOperationException: Recursive locks not allowed
I'm getting a System.InvalidOperationException: Recursive locks not allowed when doing a SaveAndPublish from code. I think it has something to do with the ContentCache.
I'm sending individual items to my Umbraco site API which then Publishes the item. The API can receive over 100 items in quick succession. The API controller is async.
The first couple of items get published correctly, all the others look like they're published in the CMS but show 'This document is published but is not in the cache' when trying to view the URL. I also have many log entries for the Recursive locks not allowed error.
Is it something to do with a lock not being released before another SaveAndPublish is attempted?
Should I make the endpoint take a list of items rather than a single item?
This import is due to be run every night fyi and I'm using Umbraco 13.
System.InvalidOperationException: Recursive locks not allowed
I'm getting a System.InvalidOperationException: Recursive locks not allowed when doing a SaveAndPublish from code. I think it has something to do with the ContentCache.
I'm sending individual items to my Umbraco site API which then Publishes the item. The API can receive over 100 items in quick succession. The API controller is async.
The first couple of items get published correctly, all the others look like they're published in the CMS but show 'This document is published but is not in the cache' when trying to view the URL. I also have many log entries for the Recursive locks not allowed error.
Is it something to do with a lock not being released before another SaveAndPublish is attempted?
Should I make the endpoint take a list of items rather than a single item?
This import is due to be run every night fyi and I'm using Umbraco 13.
Any help is greatly appreciated.
Looks like it was down to the way I was posting to the endpoint.
I was using
SendEntityAsync() contains the HttpClient send code.
Changing it to a simple loop works
is working on a reply...