Tariff: fix caching templates (#23131)
This commit is contained in:
parent
7a486eff8b
commit
59cb75974d
2 changed files with 3 additions and 3 deletions
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue