Added temporary storage of guids of collections to be wiped on bootup when crash/reload (#109)

Co-authored-by: cake <admin@cakeandbanana.nl>
Reviewed-on: #109
Reviewed-by: defnotken <defnotken@noreply.git.lightless-sync.org>
This commit was merged in pull request #109.
This commit is contained in:
2025-12-26 20:43:01 +00:00
parent 8a41baa88b
commit 6546a658f3
6 changed files with 90 additions and 4 deletions

View File

@@ -46,6 +46,7 @@ internal sealed class PairHandlerAdapter : DisposableMediatorSubscriberBase, IPa
private readonly TextureDownscaleService _textureDownscaleService;
private readonly PairStateCache _pairStateCache;
private readonly PairPerformanceMetricsCache _performanceMetricsCache;
private readonly PenumbraTempCollectionJanitor _tempCollectionJanitor;
private readonly PairManager _pairManager;
private CancellationTokenSource? _applicationCancellationTokenSource;
private Guid _applicationId;
@@ -181,7 +182,8 @@ internal sealed class PairHandlerAdapter : DisposableMediatorSubscriberBase, IPa
ServerConfigurationManager serverConfigManager,
TextureDownscaleService textureDownscaleService,
PairStateCache pairStateCache,
PairPerformanceMetricsCache performanceMetricsCache) : base(logger, mediator)
PairPerformanceMetricsCache performanceMetricsCache,
PenumbraTempCollectionJanitor tempCollectionJanitor) : base(logger, mediator)
{
_pairManager = pairManager;
Ident = ident;
@@ -199,7 +201,7 @@ internal sealed class PairHandlerAdapter : DisposableMediatorSubscriberBase, IPa
_textureDownscaleService = textureDownscaleService;
_pairStateCache = pairStateCache;
_performanceMetricsCache = performanceMetricsCache;
LastAppliedDataBytes = -1;
_tempCollectionJanitor = tempCollectionJanitor;
}
public void Initialize()
@@ -422,6 +424,7 @@ internal sealed class PairHandlerAdapter : DisposableMediatorSubscriberBase, IPa
{
_penumbraCollection = created;
_pairStateCache.StoreTemporaryCollection(Ident, created);
_tempCollectionJanitor.Register(created);
}
return _penumbraCollection;
@@ -454,6 +457,7 @@ internal sealed class PairHandlerAdapter : DisposableMediatorSubscriberBase, IPa
_needsCollectionRebuild = true;
_forceFullReapply = true;
_forceApplyMods = true;
_tempCollectionJanitor.Unregister(toRelease);
}
if (!releaseFromPenumbra || toRelease == Guid.Empty || !_ipcManager.Penumbra.APIAvailable)

View File

@@ -31,6 +31,7 @@ internal sealed class PairHandlerAdapterFactory : IPairHandlerAdapterFactory
private readonly TextureDownscaleService _textureDownscaleService;
private readonly PairStateCache _pairStateCache;
private readonly PairPerformanceMetricsCache _pairPerformanceMetricsCache;
private readonly PenumbraTempCollectionJanitor _tempCollectionJanitor;
public PairHandlerAdapterFactory(
ILoggerFactory loggerFactory,
@@ -48,7 +49,8 @@ internal sealed class PairHandlerAdapterFactory : IPairHandlerAdapterFactory
ServerConfigurationManager serverConfigManager,
TextureDownscaleService textureDownscaleService,
PairStateCache pairStateCache,
PairPerformanceMetricsCache pairPerformanceMetricsCache)
PairPerformanceMetricsCache pairPerformanceMetricsCache,
PenumbraTempCollectionJanitor tempCollectionJanitor)
{
_loggerFactory = loggerFactory;
_mediator = mediator;
@@ -66,6 +68,7 @@ internal sealed class PairHandlerAdapterFactory : IPairHandlerAdapterFactory
_textureDownscaleService = textureDownscaleService;
_pairStateCache = pairStateCache;
_pairPerformanceMetricsCache = pairPerformanceMetricsCache;
_tempCollectionJanitor = tempCollectionJanitor;
}
public IPairHandlerAdapter Create(string ident)
@@ -91,6 +94,7 @@ internal sealed class PairHandlerAdapterFactory : IPairHandlerAdapterFactory
_serverConfigManager,
_textureDownscaleService,
_pairStateCache,
_pairPerformanceMetricsCache);
_pairPerformanceMetricsCache,
_tempCollectionJanitor);
}
}