make storage size calculation asynchronous and running in parallel

This commit is contained in:
rootdarkarchon
2024-02-15 02:38:41 +01:00
committed by Loporrit
parent 50990542fd
commit e1ca5dd6f8
9 changed files with 105 additions and 35 deletions

View File

@@ -305,6 +305,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
public Task StartAsync(CancellationToken cancellationToken)
{
_logger.LogInformation("Starting DalamudUtilService");
#pragma warning disable S2696 // Instance members should not write to "static" fields
LoporritSync.Plugin.Self._realOnFrameworkUpdate = this.FrameworkOnUpdate;
#pragma warning restore S2696
@@ -314,6 +315,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
_classJobId = _clientState.LocalPlayer!.ClassJob.RowId;
}
_logger.LogInformation("Started DalamudUtilService");
return Task.CompletedTask;
}

View File

@@ -54,7 +54,7 @@ public sealed class MareMediator : IHostedService
public Task StartAsync(CancellationToken cancellationToken)
{
_logger.LogTrace("Starting MareMediator");
_logger.LogInformation("Starting MareMediator");
_ = Task.Run(async () =>
{
@@ -73,7 +73,7 @@ public sealed class MareMediator : IHostedService
}
});
_logger.LogTrace("Started MareMediator");
_logger.LogInformation("Started MareMediator");
return Task.CompletedTask;
}

View File

@@ -78,7 +78,9 @@ public sealed class PerformanceCollectorService : IHostedService
public Task StartAsync(CancellationToken cancellationToken)
{
_logger.LogInformation("Starting PerformanceCollectorService");
_ = Task.Run(PeriodicLogPrune, _periodicLogPruneTask.Token);
_logger.LogInformation("Started PerformanceCollectorService");
return Task.CompletedTask;
}