forked from gongxuegit/tiku-backend.net
feat(security): complete capability messaging workflows
This commit is contained in:
@@ -2,12 +2,14 @@ using Microsoft.Extensions.Options;
|
||||
using Tiku.Application.Jobs;
|
||||
using Tiku.Application.Security;
|
||||
using Tiku.Application.Tenancy;
|
||||
using Tiku.Infrastructure.Messaging;
|
||||
|
||||
namespace Tiku.Worker;
|
||||
|
||||
public class Worker(
|
||||
IServiceScopeFactory scopeFactory,
|
||||
IOptions<DomainLifecycleOptions> options,
|
||||
MessagingOptions messagingOptions,
|
||||
ILogger<Worker> logger) : BackgroundService
|
||||
{
|
||||
private readonly string workerId = $"{Environment.MachineName}:{Guid.NewGuid():N}";
|
||||
@@ -60,6 +62,10 @@ public class Worker(
|
||||
.InitializeSystem(null, "Background job lease worker");
|
||||
return await scope.ServiceProvider
|
||||
.GetRequiredService<IBackgroundJobService>()
|
||||
.ProcessPendingAsync(workerId, 20, stoppingToken);
|
||||
.ProcessPendingAsync(
|
||||
workerId,
|
||||
20,
|
||||
includeImmediateJobs: !messagingOptions.IsConfigured,
|
||||
cancellationToken: stoppingToken);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user