Tariffs: avoid duplicate cache writes
This commit is contained in:
parent
6d2a1bca6f
commit
e998809d10
2 changed files with 11 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ type cached struct {
|
|||
}
|
||||
|
||||
func cacheKey(typ string, other map[string]any) string {
|
||||
return fmt.Sprintf("%x", sha256.Sum256([]byte(fmt.Sprintf("%s-%v", typ, other))))
|
||||
return fmt.Sprintf("%x", sha256.Sum256(fmt.Appendf(nil, "%s-%v", typ, other)))
|
||||
}
|
||||
|
||||
func cachePut(key string, typ api.TariffType, rates api.Rates) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue