misc/soliscloud-inverter-control#5: Retry on Soliscloud API Failure



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: PoC
Created: 01-Jan-25 12:45



Description

Calls to the Soliscloud API sometimes fail - the upstream has to establish comms with our inverter, which apparently fails sometimes.

Rather than simply returning an error to our caller, we should probably retry the call first.

If we do retry, we need to let the caller know that we did so.



Toggle State Changes

Activity


assigned to @btasker

verified

mentioned in commit fe9aa8bc66e05bc3cae1eff2b8518241a7a65ba3

Commit: fe9aa8bc66e05bc3cae1eff2b8518241a7a65ba3 
Author: B Tasker                            
                            
Date: 2025-01-01T14:36:30.000+00:00 

Message

feat: automatically retry if an API call fails (misc/soliscloud-inverter-control#5)

If an API call fails, wait a few seconds and then try again

+53 -21 (74 lines changed)

The commit above introduces a single retry.

There are a couple of env vars responsible for controlling this behaviour

  • RETRIES_ENABLED (default true): whether failed calls should retry
  • RETRY_DELAY (default 3): the delay in seconds before the next call is made