mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-17 04:30:03 +02:00
app/abi/cache.go: in key() change separator to "::"
This commit is contained in:
parent
e377942d23
commit
62f898f38c
2 changed files with 4 additions and 4 deletions
|
|
@ -38,5 +38,5 @@ func (cache *Cache) Set(account string, abi *eos.ABI, ttl time.Duration) error {
|
|||
}
|
||||
|
||||
func (cache *Cache) key(account string) string {
|
||||
return cache.prefix + "." + account
|
||||
return cache.prefix + "::" + account
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ var abiString = `
|
|||
func TestGetSet(t *testing.T) {
|
||||
client, mock := redismock.NewClientMock()
|
||||
|
||||
c := NewCache("abi.cache.test", &redis_cache.Options{
|
||||
c := NewCache("thalos::cache::test", &redis_cache.Options{
|
||||
Redis: client,
|
||||
// Cache 10k keys for 1 minute.
|
||||
LocalCache: redis_cache.NewTinyLFU(10000, time.Minute),
|
||||
|
|
@ -86,7 +86,7 @@ func TestGetSet(t *testing.T) {
|
|||
|
||||
bytes, _ := c.c.Marshal(*abi)
|
||||
|
||||
mock.ExpectSet("abi.cache.test.testaccount", bytes, time.Minute).SetVal("OK")
|
||||
mock.ExpectSet("thalos::cache::test::testaccount", bytes, time.Minute).SetVal("OK")
|
||||
|
||||
err = c.Set("testaccount", abi, time.Minute)
|
||||
assert.NoError(t, err)
|
||||
|
|
@ -147,7 +147,7 @@ func TestGetSet(t *testing.T) {
|
|||
func TestCacheMiss(t *testing.T) {
|
||||
client, _ := redismock.NewClientMock()
|
||||
|
||||
c := NewCache("abi.cache.test", &redis_cache.Options{
|
||||
c := NewCache("thalos::cache::test", &redis_cache.Options{
|
||||
Redis: client,
|
||||
// Cache 10k keys for 1 minute.
|
||||
LocalCache: redis_cache.NewTinyLFU(10000, time.Minute),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue