Fix some stuff

This commit is contained in:
2025-10-28 16:57:25 +09:00
parent 1a097a8f7b
commit 3bd7341ecc
6 changed files with 19 additions and 26 deletions

View File

@ -7,7 +7,12 @@ namespace Hcs.WebApp.BackgroundServices.CampaignManagers
{
public override async Task StartAsync(IServiceScope scope)
{
if (campaign.Step > 0) return;
if (campaign.StartedAt.HasValue)
{
State = IManager.ManagerState.Started;
return;
}
var headquartersService = scope.ServiceProvider.GetRequiredService<HeadquartersService>();
var registryService = scope.ServiceProvider.GetRequiredService<RegistryService>();
@ -49,9 +54,9 @@ namespace Hcs.WebApp.BackgroundServices.CampaignManagers
var hasActiveOperations = await headquartersService.HasActiveOperationsAsync(campaign.Id);
if (!hasActiveOperations)
{
State = IManager.ManagerState.Ended;
await headquartersService.SetCampaignEndedAsync(campaign.Id);
State = IManager.ManagerState.Ended;
}
}
}