mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-30 02:28:53 +00:00
Auto-merge for PR #715 via VersionBot
Add a backoff mechanism for state reporting errors.
This commit is contained in:
commit
50e9df08fc
@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
|
||||
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## v7.16.3 - 2018-08-01
|
||||
|
||||
* Add a backoff mechanism for state reporting errors #715 [Pagan Gazzard]
|
||||
|
||||
## v7.16.2 - 2018-07-25
|
||||
|
||||
* Fix: Fix scoping issue with variables in service-manager #711 [Cameron Diver]
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "resin-supervisor",
|
||||
"description": "This is resin.io's Supervisor, a program that runs on IoT devices and has the task of running user Apps (which are Docker containers), and updating them as Resin's API informs it to.",
|
||||
"version": "7.16.2",
|
||||
"version": "7.16.3",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -16,7 +16,7 @@ DuplicateUuidError = (err) ->
|
||||
ExchangeKeyError = class ExchangeKeyError extends TypedError
|
||||
|
||||
REPORT_SUCCESS_DELAY = 1000
|
||||
REPORT_RETRY_DELAY = 5000
|
||||
MAX_REPORT_RETRY_DELAY = 60000
|
||||
|
||||
createAPIBinderRouter = (apiBinder) ->
|
||||
router = express.Router()
|
||||
@ -439,7 +439,8 @@ module.exports = class APIBinder
|
||||
.catch (err) =>
|
||||
@stateReportErrors += 1
|
||||
@eventTracker.track('Device state report failure', { error: err })
|
||||
Promise.delay(REPORT_RETRY_DELAY)
|
||||
delay = Math.min((2 ** @stateReportErrors) * 500, MAX_REPORT_RETRY_DELAY)
|
||||
Promise.delay(delay)
|
||||
.then =>
|
||||
@_reportCurrentState()
|
||||
return null
|
||||
|
Loading…
Reference in New Issue
Block a user