adjust grabbing all keys from redis on the shards
This commit is contained in:
@@ -36,12 +36,16 @@ public class SystemInfoService : IHostedService, IDisposable
|
|||||||
{
|
{
|
||||||
_logger.LogInformation("System Info Service started");
|
_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;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PushSystemInfo(object state)
|
private void PushSystemInfo(object state)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
ThreadPool.GetAvailableThreads(out int workerThreads, out int ioThreads);
|
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());
|
_mareMetrics.SetGaugeTo(MetricsAPI.GaugeUsersRegistered, db.Users.AsNoTracking().Count());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogWarning(ex, "Failed to push system info");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Task StopAsync(CancellationToken cancellationToken)
|
public Task StopAsync(CancellationToken cancellationToken)
|
||||||
|
|||||||
Reference in New Issue
Block a user