Skip to content

Instantly share code, notes, and snippets.

@mythz
Last active June 29, 2020 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mythz/7a3016a3b7121af091fa1de71b844b91 to your computer and use it in GitHub Desktop.
Save mythz/7a3016a3b7121af091fa1de71b844b91 to your computer and use it in GitHub Desktop.
Redis RemoveAll repro
using System;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.Redis;
using ServiceStack.DataAnnotations;
var redisManager = new RedisManagerPool("localhost:6379");
var redis = redisManager.GetClient();
redis.FlushAll();
var cache = redisManager.GetCacheClient();
cache.Set("siafracc_QUERY_Deposit__Query_Deposit_10_1", "A");
cache.Set("siafracc_QUERY_Deposit__0_1___CUSTOM", "A");
var keys = cache.GetKeysStartingWith("siafracc_QUERY_Deposit");
cache.RemoveAll(keys);
var newKeys = cache.GetKeysStartingWith("siafracc_QUERY_Deposit");
"oldKeys:".Print();
keys.PrintDump();
"newKeys:".Print();
newKeys.PrintDump();
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Memory" version="4.5.4" targetFramework="net45" />
<package id="ServiceStack.Text" version="5.9.0" targetFramework="net45" />
<package id="ServiceStack.Client" version="5.9.0" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="5.9.0" targetFramework="net45" />
<package id="ServiceStack.Redis" version="5.9.0" targetFramework="net45" />
<package id="ServiceStack" version="5.9.0" targetFramework="net45" />
</packages>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment