mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-03 11:53:41 +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
|
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
|
return &v, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Cache) Set(account string, abi *eos.ABI, ttl time.Duration) error {
|
func (cache *Cache) Set(account string, abi *eos.ABI, ttl time.Duration) error {
|
||||||
return this.c.Set(&redis_cache.Item{
|
return cache.c.Set(&redis_cache.Item{
|
||||||
Ctx: this.ctx,
|
Ctx: cache.ctx,
|
||||||
Key: this.key(account),
|
Key: cache.key(account),
|
||||||
Value: *abi,
|
Value: *abi,
|
||||||
TTL: ttl,
|
TTL: ttl,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Cache) key(account string) string {
|
func (cache *Cache) key(account string) string {
|
||||||
return this.prefix + "." + account
|
return cache.prefix + "." + account
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue