mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
internal/abi_cache/cache.go: change "this" variable to "cache".
This commit is contained in:
parent
caf7460875
commit
9c3bd1e879
1 changed files with 8 additions and 8 deletions
|
|
@ -22,21 +22,21 @@ func New(prefix string, options *redis_cache.Options) *Cache {
|
|||
}
|
||||
}
|
||||
|
||||
func (this *Cache) Get(account string) (*eos.ABI, error) {
|
||||
func (cache *Cache) Get(account string) (*eos.ABI, error) {
|
||||
var v eos.ABI
|
||||
err := this.c.Get(this.ctx, this.key(account), &v)
|
||||
err := cache.c.Get(cache.ctx, cache.key(account), &v)
|
||||
return &v, err
|
||||
}
|
||||
|
||||
func (this *Cache) Set(account string, abi *eos.ABI, ttl time.Duration) error {
|
||||
return this.c.Set(&redis_cache.Item{
|
||||
Ctx: this.ctx,
|
||||
Key: this.key(account),
|
||||
func (cache *Cache) Set(account string, abi *eos.ABI, ttl time.Duration) error {
|
||||
return cache.c.Set(&redis_cache.Item{
|
||||
Ctx: cache.ctx,
|
||||
Key: cache.key(account),
|
||||
Value: *abi,
|
||||
TTL: ttl,
|
||||
})
|
||||
}
|
||||
|
||||
func (this *Cache) key(account string) string {
|
||||
return this.prefix + "." + account
|
||||
func (cache *Cache) key(account string) string {
|
||||
return cache.prefix + "." + account
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue