jamesmontemagno / monkey-cache

Easily cache any data structure for a specific amount of time in any .NET application.
MIT License
669 stars 106 forks source link

Get Expiration. #120

Open AxopoulosDennis opened 1 year ago

AxopoulosDennis commented 1 year ago

Hey Guys. I'm using Barrel.Current.Add(key, data, 2hours); But when im using Barrel.Current.GetExpiration(key); It returns back that cache has been expired just now. So it will return me utc 0 time zone for expiration but for add will register with server timezone. Because when I want to use the data that is supposed to be expired based on GetExpiration, it's still there.

So the workaround for me it's Adding 2hours on get expiration to check for expired cached data.

Is it me that I'm doing something wrong?

jamesmontemagno commented 1 year ago

Which version number are you using and which of the libraries are you using?

AxopoulosDennis commented 1 year ago

I'm using MonkeyCache.Filestore 1.6.3 with .net7. I'll try to update it on 2.0.1 and see if it is fixed on that version.

AxopoulosDennis commented 1 year ago

Meh, eventually It is not good time to update cause i see methods have changed an I have to publish the project.

AxopoulosDennis commented 1 year ago

I also use

Newtonsoft.Json 13.02 Restsharp 106.15.0 Plugin.Firebase 1.2.5 Plugin.Fingerprint 3.0.0 CommunityToolkit.Maui 4.00 CommunityToolkit.Mvvm 8.0.0

In case it could be a conflict or i don't know 😅.

AxopoulosDennis commented 1 year ago

Its 10:50 am here.

image

image