mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-06-19 15:53:46 +00:00
Switch to monitoring if the host is reachable via tcp, rather than a using a full http request.
This commit is contained in:
committed by
Pablo Carranza Vélez
parent
a97cd40b44
commit
c29e0720c6
@ -17,7 +17,7 @@
|
|||||||
"knex": "~0.7.3",
|
"knex": "~0.7.3",
|
||||||
"lodash": "^3.0.0",
|
"lodash": "^3.0.0",
|
||||||
"mixpanel": "0.0.20",
|
"mixpanel": "0.0.20",
|
||||||
"network-checker": "~0.0.2",
|
"network-checker": "~0.0.3",
|
||||||
"ngrok": "~0.1.97",
|
"ngrok": "~0.1.97",
|
||||||
"pinejs-client": "^1.2.0",
|
"pinejs-client": "^1.2.0",
|
||||||
"pubnub": "~3.6.4",
|
"pubnub": "~3.6.4",
|
||||||
|
@ -24,8 +24,6 @@ module.exports = config =
|
|||||||
appUpdatePollInterval: checkInt(process.env.APPLICATION_UPDATE_POLL_INTERVAL) ? 60000
|
appUpdatePollInterval: checkInt(process.env.APPLICATION_UPDATE_POLL_INTERVAL) ? 60000
|
||||||
successMessage: 'SUPERVISOR OK'
|
successMessage: 'SUPERVISOR OK'
|
||||||
|
|
||||||
config.heartbeatEndpoint = config.apiEndpoint + '/ping'
|
|
||||||
|
|
||||||
config.supervisorContainer =
|
config.supervisorContainer =
|
||||||
Volumes:
|
Volumes:
|
||||||
'/boot/config.json': {}
|
'/boot/config.json': {}
|
||||||
|
@ -5,6 +5,7 @@ config = require './config'
|
|||||||
mixpanel = require 'mixpanel'
|
mixpanel = require 'mixpanel'
|
||||||
networkCheck = require 'network-checker'
|
networkCheck = require 'network-checker'
|
||||||
blink = require('blinking')(config.ledFile)
|
blink = require('blinking')(config.ledFile)
|
||||||
|
url = require 'url'
|
||||||
|
|
||||||
utils = exports
|
utils = exports
|
||||||
|
|
||||||
@ -64,9 +65,12 @@ networkPattern =
|
|||||||
pause: 1000
|
pause: 1000
|
||||||
|
|
||||||
exports.blink = blink
|
exports.blink = blink
|
||||||
|
|
||||||
exports.connectivityCheck = _.once ->
|
exports.connectivityCheck = _.once ->
|
||||||
networkCheck.monitorURL
|
parsedUrl = url.parse(config.apiEndpoint)
|
||||||
url: config.heartbeatEndpoint
|
networkCheck.monitorHost
|
||||||
|
host: parsedUrl.hostname
|
||||||
|
port: parsedUrl.port ? (if parsedUrl.protocol is 'https:' then 443 else 80)
|
||||||
interval: 10 * 1000
|
interval: 10 * 1000
|
||||||
(connected) ->
|
(connected) ->
|
||||||
if connected
|
if connected
|
||||||
|
Reference in New Issue
Block a user