refactor(jobs): modularize background job handlers
Some checks failed
ci / release-gate (push) Has been cancelled
Some checks failed
ci / release-gate (push) Has been cancelled
This commit is contained in:
19
Tiku.Infrastructure/Tenancy/TenantDomainRecheckJobHandler.cs
Normal file
19
Tiku.Infrastructure/Tenancy/TenantDomainRecheckJobHandler.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Text.Json;
|
||||
using Tiku.Application.Jobs;
|
||||
using Tiku.Application.Tenancy;
|
||||
|
||||
namespace Tiku.Infrastructure.Tenancy;
|
||||
|
||||
internal sealed class TenantDomainRecheckJobHandler(ITenantDomainLifecycleService lifecycleService)
|
||||
: IBackgroundJobHandler
|
||||
{
|
||||
public string JobType => "tenant_domain_recheck";
|
||||
|
||||
public async Task<BackgroundJobHandlerResult> HandleAsync(
|
||||
BackgroundJobExecutionContext context,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
var processed = await lifecycleService.ProcessPendingAsync(cancellationToken);
|
||||
return new BackgroundJobHandlerResult(JsonSerializer.SerializeToElement(new { processed }));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user