Tariffs: avoid duplicate cache writes

This commit is contained in:
andig 2025-09-13 15:20:36 +02:00
parent 6d2a1bca6f
commit e998809d10
2 changed files with 11 additions and 2 deletions

View file

@ -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 {