Skip to content

Commit

Permalink
Fix cache size MiB conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Oct 14, 2022
1 parent da51052 commit 8f7e340
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/ImageResizer.Plugins.HybridCache/HybridCachePlugin.cs
Expand Up @@ -177,7 +177,7 @@ private static Imazen.HybridCache.HybridCache CreateHybridCacheFromOptions(Hybri
{
AsyncCacheOptions = new AsyncCacheOptions()
{
MaxQueuedBytes = Math.Max(0, options.WriteQueueMemoryMb),
MaxQueuedBytes = Math.Max(0, options.WriteQueueMemoryMb) * 1024 * 1024,
WriteSynchronouslyWhenQueueFull = true,
MoveFileOverwriteFunc = (from, to) =>
{
Expand All @@ -187,8 +187,8 @@ private static Imazen.HybridCache.HybridCache CreateHybridCacheFromOptions(Hybri
},
CleanupManagerOptions = new CleanupManagerOptions()
{
MaxCacheBytes = Math.Max(0, options.CacheSizeMb),
MinCleanupBytes = Math.Max(1, options.EvictionSweepSizeMb),
MaxCacheBytes = Math.Max(0, options.CacheSizeMb) * 1024 * 1024,
MinCleanupBytes = Math.Max(1, options.EvictionSweepSizeMb) * 1024 * 1024,
MinAgeToDelete = options.MinAgeToDelete.Ticks > 0 ? options.MinAgeToDelete : TimeSpan.Zero
}
};
Expand Down

0 comments on commit 8f7e340

Please sign in to comment.