mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-03-25 10:03:17 -04:00
Fix StatusWorker bug where services didn't start automatically after a fresh install (#1758)
This commit is contained in:
committed by
Leendert de Borst
parent
4e4c0d73cb
commit
234ac00a85
@@ -128,7 +128,7 @@
|
||||
{
|
||||
buttonClass += "bg-emerald-500";
|
||||
}
|
||||
else if (service.DesiredStatus == "Stopped" && (service.DesiredStatus == string.Empty || service.DesiredStatus == "Stopped"))
|
||||
else if (service.CurrentStatus == "Stopped" && (service.DesiredStatus == string.Empty || service.DesiredStatus == "Stopped"))
|
||||
{
|
||||
buttonClass += "bg-red-600";
|
||||
}
|
||||
|
||||
@@ -217,13 +217,15 @@ public class StatusWorker(ILogger<StatusWorker> logger, Func<IWorkerStatusDbCont
|
||||
var entry = new WorkerServiceStatus
|
||||
{
|
||||
ServiceName = globalServiceStatus.ServiceName,
|
||||
CurrentStatus = Status.Started.ToString(),
|
||||
DesiredStatus = string.Empty,
|
||||
CurrentStatus = Status.Stopped.ToString(),
|
||||
DesiredStatus = Status.Started.ToString(),
|
||||
Heartbeat = DateTime.UtcNow,
|
||||
};
|
||||
_dbContext.WorkerServiceStatuses.Add(entry);
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
logger.LogInformation("Created initial status record for service {ServiceName} with CurrentStatus={CurrentStatus}, DesiredStatus={DesiredStatus}", globalServiceStatus.ServiceName, entry.CurrentStatus, entry.DesiredStatus);
|
||||
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user