chore: make horizon depend on instance
This commit is contained in:
parent
00216f46af
commit
ab1c0202fb
1 changed files with 5 additions and 3 deletions
|
|
@ -120,8 +120,11 @@ func (site *Site) optimizerUpdate(battery []types.Measurement) error {
|
|||
minLen = min(minLen, len(solar))
|
||||
}
|
||||
|
||||
// limit to 2 days for sake of performance
|
||||
minLen = min(2*96, minLen)
|
||||
uri := os.Getenv("OPTIMIZER_URI")
|
||||
if uri == "" {
|
||||
uri = OPTIMIZER_URI
|
||||
minLen = min(2*96, minLen) // limit to 2 days for sake of performance
|
||||
}
|
||||
|
||||
if expectedSlots := 8; minLen < expectedSlots {
|
||||
if solarTariff != nil {
|
||||
|
|
@ -229,7 +232,6 @@ func (site *Site) optimizerUpdate(battery []types.Measurement) error {
|
|||
httpClient := request.NewClient(site.log)
|
||||
httpClient.Timeout = 30 * time.Second
|
||||
|
||||
uri := lo.CoalesceOrEmpty(os.Getenv("OPTIMIZER_URI"), OPTIMIZER_URI)
|
||||
apiClient, err := optimizer.NewClientWithResponses(uri, optimizer.WithHTTPClient(httpClient))
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue