adjust grabbing all keys from redis on the shards

This commit is contained in:
rootdarkarchon
2023-01-08 21:04:11 +01:00
parent f37fee3235
commit db2d0451ca

View File

@@ -36,12 +36,16 @@ public class SystemInfoService : IHostedService, IDisposable
{
_logger.LogInformation("System Info Service started");
_timer = new Timer(PushSystemInfo, null, TimeSpan.Zero, TimeSpan.FromSeconds(5));
var timeOut = _config.IsMain ? 5 : 15;
_timer = new Timer(PushSystemInfo, null, TimeSpan.Zero, TimeSpan.FromSeconds(timeOut));
return Task.CompletedTask;
}
private void PushSystemInfo(object state)
{
try
{
ThreadPool.GetAvailableThreads(out int workerThreads, out int ioThreads);
@@ -72,6 +76,11 @@ public class SystemInfoService : IHostedService, IDisposable
_mareMetrics.SetGaugeTo(MetricsAPI.GaugeUsersRegistered, db.Users.AsNoTracking().Count());
}
}
catch (Exception ex)
{
_logger.LogWarning(ex, "Failed to push system info");
}
}
public Task StopAsync(CancellationToken cancellationToken)