We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code: class Program {
private static readonly ILockProvider _lockProvider = new CacheLockProvider(new InMemoryCacheClient(), new InMemoryMessageBus()); static async Task Main(string[] args) { var @lock = await _lockProvider.AcquireAsync("TestLock", TimeSpan.FromSeconds(5)); _ = Task.Run(async () => { while (true) { await Task.Delay(TimeSpan.FromSeconds(3)); await @lock.RenewAsync(TimeSpan.FromSeconds(5)); } }); _ = Task.Run(async () => { while (true) { await Task.Delay(TimeSpan.FromSeconds(3)); Console.WriteLine($"state: {await _lockProvider.IsLockedAsync("TestLock")}"); } }); await Task.Delay(-1); } }
the result I Expected is : state: True state: True state: True state: True ........
but actually, the result is : state: True state: False state: False state: False ......
what's the problem?
The text was updated successfully, but these errors were encountered:
I Found a bug in Foundatio.Caching.InMemoryCacheClient --> ReplaceIfEqualAsync you didn't update the expire time when update the cache value.
Sorry, something went wrong.
Awesome find, any chance you could add this as a test case and submit a pr!
@xulei-Itachi could you please submit a pr for this.
Fixes #285: InMemoryCacheClient ReplaceIfEqualAsync was not setting c…
a70ce7b
…ache expiration causing locks to fail
0eea68f
niemyjski
No branches or pull requests
code:
class Program
{
the result I Expected is :
state: True
state: True
state: True
state: True
........
but actually, the result is :
state: True
state: False
state: False
state: False
......
what's the problem?
The text was updated successfully, but these errors were encountered: