EnyimMemcached uses the DateTime parameter to set the value after expiration to solve the problem. enyimmemcached
Environment: win10 64-bit, memcached 1.4.4 64-bit, and EnyimMemcached 2.16.0 (ps: 2.6.2 ).
EnyimMemcached git Source Code address: https://github.com/enyim/EnyimMemcached
Cause of the incident: recently, I was trying to think about redis and Memcached cache as a public class for convenience and convenience. redis was quickly ready, memcached looks like EnyimMemcached is used a lot on the Internet (previously, Memcached was used. clientLibrary is directly filtered out because it has not been updated for many years .), start work immediately, search for and install NuGet in vs, and test the application directly,
There are three methods in it. I didn't see that much. I used the second DateTime directly. I didn't try anything else. An error was returned when Get obtained the value, the prompt is not instantiated (is there no value for instantiation?), so when we look at the value assignment, the result shows that true is returned, and the value assignment is successful, but the value is reported wrong. After a long time, it is useless to check and modify the configuration. You can use the command line to assign a value, but it is very helpless.
I accidentally used TimeSpan later, but succeeded. (I never thought it would be a parameter reason !). So we can find the source code above.
There is no difference in the Code. The MemcachedClient. GetExpiration reloads are different. Continue with the GetExpiration method.
The returned results are of the uint type. In the result DateTime parameter, the uint type is returned as follows: uint retval = (uint) (expiresAt. ToUniversalTime ()-UnixEpoch). TotalSeconds;
This is not the return timestamp. the TimeSpan parameter returns the number of minutes. If you cannot figure it out, the same one that returns the call is the timestamp and the other is the number of minutes.
Change it to the following minute: uint retval = (uint) (expiresAt-DateTime. Now). TotalSeconds;
OK. Compile and load the dll into your project. The value is successfully assigned by the DateTime parameter!