fix: Properly bind context to healthchecks

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2019-01-29 14:13:51 +00:00
parent 707ddb5f45
commit 6a9ca2a60d
No known key found for this signature in database
GPG Key ID: 49690ED87032539F

View File

@ -37,7 +37,18 @@ module.exports = class Supervisor extends EventEmitter
# FIXME: rearchitect proxyvisor to avoid this circular dependency
# by storing current state and having the APIBinder query and report it / provision devices
@deviceState.applications.proxyvisor.bindToAPI(@apiBinder)
@api = new SupervisorAPI({ @config, @eventTracker, routers: [ @apiBinder.router, @deviceState.router ], healthchecks: [ @apiBinder.healthcheck, @deviceState.healthcheck ] })
@api = new SupervisorAPI({
@config,
@eventTracker,
routers: [
@apiBinder.router,
@deviceState.router
],
healthchecks: [
@apiBinder.healthcheck.bind(@apiBinder),
@deviceState.healthcheck.bind(@deviceState)
]
})
init: =>
@db.init()