refactor(jobs): modularize background job handlers
Some checks failed
ci / release-gate (push) Has been cancelled

This commit is contained in:
2026-08-03 13:28:21 +08:00
parent c497a3ca8d
commit 7adcb6a3d5
21 changed files with 871 additions and 645 deletions

View 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 }));
}
}