mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 13:43:06 -04:00
shut down if session is invalid
This commit is contained in:
parent
2b7b2b2dfc
commit
3caf2327be
1 changed files with 8 additions and 0 deletions
8
index.js
8
index.js
|
@ -1,5 +1,6 @@
|
|||
const { ClusterManager } = require('detritus-client');
|
||||
const { basecamp } = require('./labscore/logging');
|
||||
const superagent = require('superagent')
|
||||
|
||||
const time = Date.now();
|
||||
|
||||
|
@ -36,4 +37,11 @@ const manager = new ClusterManager(client, token, {
|
|||
|
||||
await manager.run();
|
||||
console.log(`v2 | ready. took ${(Date.now() - time) / 1000}.`)
|
||||
|
||||
let liveDeploy = await superagent.get(`${process.env.PB_MANAGER_HOST}_pbs/GetPbServiceId`)
|
||||
if(process.env.HOSTNAME !== liveDeploy.body.d){
|
||||
console.log(`[${process.env.HOSTNAME}] invalid deployment session`)
|
||||
process.exit();
|
||||
}
|
||||
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue