Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbannov committed Dec 20, 2023
1 parent 5e440e3 commit bccdc13
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions products/ASC.Files/Core/Utils/FileTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,20 @@ private Action<object, object, EvictionReason, object> EvictionCallback()
{
return (cacheFileId, fileTracker, reason, _) =>
{
if (reason != EvictionReason.Expired)
if (reason != EvictionReason.Expired || cacheFileId == null)
{
return;
}

var fId = cacheFileId.ToString()?.Substring(Tracker.Length);

if(int.TryParse(cacheFileId?.ToString(), out var internalFileId))
if(int.TryParse(fId, out var internalFileId))
{
Callback(internalFileId, fileTracker as FileTracker).Wait();
}
else
{
Callback(cacheFileId?.ToString(), fileTracker as FileTracker).Wait();
Callback(fId, fileTracker as FileTracker).Wait();
}
};

Expand Down

0 comments on commit bccdc13

Please sign in to comment.