Fix agent count
This commit is contained in:
@@ -81,7 +81,6 @@ public class PlatformSummaryGrain : Grain, IPlatformSummaryGrain, IRemindable
|
||||
_logger.LogInformation("Created initial empty daily snapshot for {Date}", today);
|
||||
}
|
||||
|
||||
_state.State.TotalAgents = await _agentService.GetTotalAgentCount();
|
||||
|
||||
await RefreshDataAsync();
|
||||
}
|
||||
@@ -219,16 +218,12 @@ public class PlatformSummaryGrain : Grain, IPlatformSummaryGrain, IRemindable
|
||||
}
|
||||
}
|
||||
|
||||
public async Task IncrementAgentCountAsync()
|
||||
public async Task RefreshAgentCountAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("Incrementing agent count from {CurrentCount} to {NewCount}",
|
||||
_state.State.TotalAgents, _state.State.TotalAgents + 1);
|
||||
|
||||
_state.State.TotalAgents++;
|
||||
_state.State.TotalAgents = await _agentService.GetTotalAgentCount();
|
||||
await _state.WriteStateAsync();
|
||||
|
||||
_logger.LogInformation("Agent count incremented to: {NewCount}", _state.State.TotalAgents);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user