dotnetcore / dotnetcore/EasyCaching

FasterKv MaxRdSecond set 0 or -1 not come into effect

Open
#550 4 comments 0 reactions 1 assignee Claimed by @Memoyu View on GitHub
area-fasterkv bug
Dominant language
C#
Stars
2.1k
Forks
336
PR merge metrics
No merged PRs in 30d

Description

IServiceCollection services = new ServiceCollection();

services.AddEasyCaching(option =>
{
//use fasterkv cache
option.UseFasterKv(config =>
{
config.EnableLogging = true;
config.MaxRdSecond = -1;
}, "testcaching").WithMessagePack("testcaching");
});

IServiceProvider serviceProvider = services.BuildServiceProvider();

var factory = serviceProvider.GetService();

var caching = factory.GetCachingProvider("testcaching");

caching.TrySet("testcaching", $"testcachingmsg", TimeSpan.FromSeconds(1));

var msg = caching.Get("testcaching");

Debug.WriteLine($"caching msg->{msg}");

Thread.Sleep(3000);

var msg2 = caching.Get("testcaching", () => "12345", TimeSpan.FromSeconds(1));

Debug.WriteLine($"caching msg2->{msg2}");

print is

11:57:26:112 caching msg->testcachingmsg
11:57:29:114 caching msg2->testcachingmsg

I see issues setting MaxRdSecond to 0 or -1 has no effect

There is no such case. Why? In addition, the documentation of UseFasterKv is too few. I can only know from the preferred documentation that it is similar to the combination of UseInMemory and UseDisk. I don't know if this is the right understanding, there is so little documentation

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.