mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 16:47:22 +01:00
move gauge init into cleanup task
This commit is contained in:
parent
e633151b35
commit
355d34c730
1 changed files with 2 additions and 2 deletions
|
|
@ -32,8 +32,6 @@ public class MainFileCleanupService : IHostedService
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Cleanup Service started");
|
_logger.LogInformation("Cleanup Service started");
|
||||||
|
|
||||||
InitializeGauges();
|
|
||||||
|
|
||||||
_cleanupCts = new();
|
_cleanupCts = new();
|
||||||
|
|
||||||
_ = Task.Run(() => CleanUpTask(_cleanupCts.Token)).ConfigureAwait(false);
|
_ = Task.Run(() => CleanUpTask(_cleanupCts.Token)).ConfigureAwait(false);
|
||||||
|
|
@ -150,6 +148,8 @@ public class MainFileCleanupService : IHostedService
|
||||||
|
|
||||||
private async Task CleanUpTask(CancellationToken ct)
|
private async Task CleanUpTask(CancellationToken ct)
|
||||||
{
|
{
|
||||||
|
InitializeGauges();
|
||||||
|
|
||||||
while (!ct.IsCancellationRequested)
|
while (!ct.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
var cleanupCheckMinutes = _configuration.GetValueOrDefault(nameof(StaticFilesServerConfiguration.CleanupCheckInMinutes), 15);
|
var cleanupCheckMinutes = _configuration.GetValueOrDefault(nameof(StaticFilesServerConfiguration.CleanupCheckInMinutes), 15);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue