Move Creation of Caches to constructor thread.

This commit is contained in:
Ottermandias 2023-05-05 16:17:25 +02:00
parent e5c4743374
commit 6f6b72e7aa
4 changed files with 4 additions and 5 deletions

View file

@ -49,7 +49,7 @@ public class Penumbra : IDalamudPlugin
public Penumbra(DalamudPluginInterface pluginInterface)
{
try
{
{
var startTimer = new StartTracker();
using var timer = startTimer.Measure(StartTimeType.Total);
_services = ServiceManager.CreateProvider(this, pluginInterface, Log, startTimer);
@ -67,7 +67,8 @@ public class Penumbra : IDalamudPlugin
_redrawService = _services.GetRequiredService<RedrawService>();
_communicatorService = _services.GetRequiredService<CommunicatorService>();
_services.GetRequiredService<ResourceService>(); // Initialize because not required anywhere else.
_services.GetRequiredService<ModCacheManager>(); // Initialize because not required anywhere else.
_services.GetRequiredService<ModCacheManager>(); // Initialize because not required anywhere else.
_collectionManager.Caches.CreateNecessaryCaches();
using (var t = _services.GetRequiredService<StartTracker>().Measure(StartTimeType.PathResolver))
{
_services.GetRequiredService<PathResolver>();