You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- API uses its own backoff settings when polling. You can only configure delay between polls. Instead we are using strategy used by: AWS SDK, Google Cloud SDK, Stripe API client, Kubernetes controllers or Distributed message brokers to prevent: retry storms, thundering herd, burst collapse after outage recovery, adapter lockups or permanent dead loops. This leads to: IF (SENEC API down for 2 hours, or Token refresh fails 20 times, or 429 rate limiting kicks in, or Internet drops temporarily) ? (Never dies, never overlaps, never floods API, always recovers)
- API polling no longer honors retries-setting. It will just keep backing off exponentially if errors persist -> we keep trying until you stop the adapter.
- 401 won't throw warning anymore
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -305,7 +305,10 @@ This channel contains values polled from SENEC App-API.
305
305
-->
306
306
307
307
### **WORK IN PROGRESS**
308
+
- API uses its own backoff settings when polling. You can only configure delay between polls. Instead we are using strategy used by: AWS SDK, Google Cloud SDK, Stripe API client, Kubernetes controllers or Distributed message brokers to prevent: retry storms, thundering herd, burst collapse after outage recovery, adapter lockups or permanent dead loops. This leads to: IF (SENEC API down for 2 hours, or Token refresh fails 20 times, or 429 rate limiting kicks in, or Internet drops temporarily) ? (Never dies, never overlaps, never floods API, always recovers)
309
+
- API polling no longer honors retries-setting. It will just keep backing off exponentially if errors persist -> we keep trying until you stop the adapter.
308
310
- 401 won't throw warning anymore
311
+
- ReAuth shouldn't stop polling anymore
309
312
310
313
### 2.4.2 (2026-03-03)
311
314
- AuthToken in _api is no longer used. You can safely delete it.
@@ -622,7 +622,7 @@ class Senec extends utils.Adapter {
622
622
returnthis.refreshPromise;
623
623
}
624
624
625
-
asyncpollSenecApi(retry=0){
625
+
asyncpollSenecApi(){
626
626
if(!this.config.api_use||!apiConnected){
627
627
this.log.info("Usage of SENEC App API not configured or not connected.");
628
628
return;
@@ -632,22 +632,26 @@ class Senec extends utils.Adapter {
632
632
this.log.warn("API poll still running — skipping overlapping execution.");
633
633
return;
634
634
}
635
+
635
636
this.apiPollRunning=true;
636
-
constinterval=this.config.api_interval*60000;
637
+
638
+
constbaseInterval=this.config.api_interval*60000;
639
+
letnextDelay=baseInterval;
637
640
638
641
try{
639
642
this.log.info("🔄 Polling SENEC App API...");
643
+
640
644
// Ensure token exists
641
645
if(!this.currentToken){
642
646
awaitthis.refreshTokenSingleFlight();
643
647
}
644
648
645
-
// Read systems once from API and keep them in memory - we will need them for every poll and they don't change that often - this also ensures that we have the correct system IDs in case they change or we have multiple systems
649
+
// Read systems once from API and keep them in memory - we will need them for every poll and they don't change that often
646
650
if(apiKnownSystems.size===0){
647
651
this.log.debug("🔄 Reading available systems from API ...");
this.log.debug(`⏱ Next API poll scheduled in ${(nextDelay/1000).toFixed(0)}s`);
746
+
}
732
747
}
733
748
}
734
749
@@ -737,33 +752,35 @@ class Senec extends utils.Adapter {
737
752
*
738
753
* @param {any} url url to call
739
754
* @param config config for API call - will be extended by auth header - can be used to pass additional headers or other axios config parameters
740
-
* @param attempt number of attempts for retrying in case of 401 - to avoid infinite loops in case something is really broken and token refresh doesn't work
0 commit comments