mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-04-24 04:55:42 +00:00
Merge pull request #882 from balena-io/fix-healthcheck
Fix healthcheck and container restart
This commit is contained in:
commit
a940180bf3
1
entry.sh
1
entry.sh
@ -5,6 +5,7 @@ set -o errexit
|
||||
# Start Avahi to allow MDNS lookups
|
||||
mkdir -p /var/run/dbus
|
||||
rm -f /var/run/avahi-daemon/pid
|
||||
rm -f /var/run/dbus/pid
|
||||
/etc/init.d/dbus-1 start
|
||||
/etc/init.d/avahi-daemon start
|
||||
|
||||
|
@ -95,7 +95,6 @@ export class SupervisorAPI {
|
||||
|
||||
this.api.disable('x-powered-by');
|
||||
this.api.use(expressLogger);
|
||||
this.api.use(authenticate(this.config));
|
||||
|
||||
this.api.get('/v1/healthy', async (_req, res) => {
|
||||
try {
|
||||
@ -109,6 +108,8 @@ export class SupervisorAPI {
|
||||
}
|
||||
});
|
||||
|
||||
this.api.use(authenticate(this.config));
|
||||
|
||||
this.api.get('/ping', (_req, res) => res.send('OK'));
|
||||
|
||||
this.api.post('/v1/blink', (_req, res) => {
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user