Open laukoksoon opened 2 years ago
How long does the 300 version take? Your code only has 10s (not 30s as commented) - could it be longer than 10?
Also your expiration code is wrong - it should be using DateTiemOffset
new LazyCacheEntryOptions().SetAbsoluteExpiration(DateTimeOffset.Now.AddSeconds(10))
Describe the bug My goal here is to cache some long running process data and then upon expiration, i will get those data that going to expired and append new delta changes from database The long running process shouldn't run more than one time
To Reproduce I will attach the console program that i wrote to reproduce the issue
When i set int parallelNumber = 100; // 100 or below => All the thing run as EXPECTED
When i set int parallelNumber = 300; // 300 or allow => Long process called more than once .. [NOT OK]
Expected behavior Long process should call ONE even the parallel count set to 300 above
** Framework and Platform
Console source code
using LazyCache; using Microsoft.Extensions.Caching.Memory; using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks;
namespace ConsoleApp1 { class program { private static IAppCache _lazyCache; private static int _totalLongProcess; private static int _totalAppendProcess;
}