ServiceStack.Redis Cache Cleared when application restarted -
i using redis caching, using icacheclient in 1 of services write , read directly cache using , set etc.
redis set persist values disk. if shut redis down , restart again, cached data there. however, if run servicestack services in debug mode , stop website , restart again, servicestack clear redis cache on first call made servicestack service. how can switch off, or bug. items in cache should not expire , when checking individual items in cache, set not expire, not expiring, servicestack seems flush database on first call after restart.
public icacheclient cacheclient { get; set; } public object get(keyvalues request) { var value = cacheclient.get<object>(request.key); var response = new keyvaluesresponse { key = request.key, value = value }; return value; } public void put(keyvaluesrecord request) { if (request.key != null) { cacheclient.set(request.key,request.value); } } public void post(keyvaluesrecord request) { cacheclient.set(request.key, request.value); } public void delete(keyvalues request) { cacheclient.remove(request.key); }
when call first e.g. url : http://localhost:4099/api/keyvalues/mykey
the whole redis db(0) cleared out.
Comments
Post a Comment