Tariff: fix caching templates (#23131)

This commit is contained in:
andig 2025-08-20 19:14:49 +02:00 • committed by GitHub
parent 7a486eff8b
commit 59cb75974d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -45,7 +45,7 @@ func NewCachedFromConfig(ctx context.Context, typ string, other map[string]any)
}
if !slices.Contains(embed.Features, api.Cacheable) {
return NewFromConfig(ctx, typ, other)
return NewFromConfig(ctx, typ, embed.Other)
}
p := &CachingProxy{
@ -59,7 +59,7 @@ func NewCachedFromConfig(ctx context.Context, typ string, other map[string]any)
data, err := p.cacheGet(untilEndOfTomorrow())
if err != nil {
// attempt to create a new instance
tariff, err := NewFromConfig(ctx, typ, other)
tariff, err := NewFromConfig(ctx, typ, embed.Other)
if err != nil {
// check if we have at least data for the next 24 hours
atLeast2hrs, err2 := p.cacheGet(for24hrs())

View file

@ -17,5 +17,5 @@ func NewTariffFromTemplateConfig(ctx context.Context, other map[string]interface
return nil, err
}
return NewFromConfig(ctx, instance.Type, instance.Other)
return NewCachedFromConfig(ctx, instance.Type, instance.Other)
}