From 62f898f38c8c001a838ca3d52ff77fa11496366d Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 13 Jul 2023 07:02:29 +0200 Subject: [PATCH] app/abi/cache.go: in key() change separator to "::" --- app/abi/cache.go | 2 +- app/abi/cache_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/abi/cache.go b/app/abi/cache.go index 86c9c9e..ac595f0 100644 --- a/app/abi/cache.go +++ b/app/abi/cache.go @@ -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 } diff --git a/app/abi/cache_test.go b/app/abi/cache_test.go index 0bfb0a9..da74e74 100644 --- a/app/abi/cache_test.go +++ b/app/abi/cache_test.go @@ -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),