Open KWC252 opened 1 year ago
Is there a way to change the lock settings for this background task through a recipe?
I don't think you can do that through a recipe but can be done through the Admin UI if you enable the OC.BackgroundTasks
feature, and where you can also change the period of the task or disable it.
Otherwise nothing more to add to the comments of #11463, yes we don't have yet ootb a way to give the ownership to only one instance (need custom code), we can only prevent a task to be run by multiple instances at the same time, but each instance can still run the task one after each other.
Note: To have a distributed lock you need e.g. the RedisLock
feature and a Redis instance running.
I'll look into a solution using custom code with RedisLock - unfortunately, we can't rely on the Admin UI for this, we'd have to manually change the task settings across a lot of sites. Thanks for getting back to me so quickly on this.
Related to #13262
Every 30 minutes we're seeing a spike of certificate calls coming from OrchardCore's OpenIdBackgroundTask. Each certificate is requested up to 24 times during a spike, which only takes about a second. We think part of the problem could be that it's running on all our instances every 30 minutes. This thread says it's possible to prevent a background task from running on multiple instances, but it's for a custom task:
https://github.com/OrchardCMS/OrchardCore/issues/11463
I don't want to modify the OrchardCore code. Is there a way to change the lock settings for this background task through a recipe? Thanks.