Clarify heartbeat code
heartbeats are not sent for self-hosted cloudrons (only managed ones)
This commit is contained in:
@@ -12,7 +12,7 @@ exports = module.exports = {
|
||||
dnsSetup: dnsSetup,
|
||||
getLogs: getLogs,
|
||||
|
||||
sendHeartbeat: sendHeartbeat,
|
||||
sendCaasHeartbeat: sendCaasHeartbeat,
|
||||
|
||||
updateToLatest: updateToLatest,
|
||||
reboot: reboot,
|
||||
@@ -440,8 +440,8 @@ function getConfig(callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function sendHeartbeat() {
|
||||
if (config.provider() !== 'caas') return;
|
||||
function sendCaasHeartbeat() {
|
||||
assert(config.provider() === 'caas', 'Heartbeat is only sent for managed cloudrons');
|
||||
|
||||
var url = config.apiServerOrigin() + '/api/v1/boxes/' + config.fqdn() + '/heartbeat';
|
||||
superagent.post(url).query({ token: config.token(), version: config.version() }).timeout(30 * 1000).end(function (error, result) {
|
||||
|
||||
Reference in New Issue
Block a user