* Fix race condition and add rate limiting to bookmark queue processing Introduce rate-limited function invocation for bookmark queue processing using ThrottleDebounce library to optimize performance. Update related classes and interfaces to support asynchronous and cancellation-aware operations, improving system responsiveness. Adjust logging to provide more detailed information during bookmark queue handling. * Enable workflows on bug branches This change updates the GitHub Actions workflow configuration to trigger on branches with the 'bug/*' pattern. This allows for automated actions on bug fix branches alongside the main branch, improving development and testing processes.
28 lines
849 B
C#
28 lines
849 B
C#
using Elsa.Common;
|
|
using JetBrains.Annotations;
|
|
|
|
namespace Elsa.Workflows.Runtime.Tasks;
|
|
|
|
/// <summary>
|
|
/// Periodically signals the bookmark queue processor to check for new items. This is a reliability measure that ensures stimuli never gets missed.
|
|
/// </summary>
|
|
[UsedImplicitly]
|
|
public class TriggerBookmarkQueueRecurringTask(IBookmarkQueueWorker bookmarkQueueWorker, IBookmarkQueueSignaler signaler) : IRecurringTask
|
|
{
|
|
public Task StartAsync(CancellationToken cancellationToken)
|
|
{
|
|
bookmarkQueueWorker.Start();
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public Task StopAsync(CancellationToken cancellationToken)
|
|
{
|
|
bookmarkQueueWorker.Stop();
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public Task ExecuteAsync(CancellationToken stoppingToken)
|
|
{
|
|
return signaler.TriggerAsync(stoppingToken);
|
|
}
|
|
} |