Commit 79fcb898 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 5caa1367
......@@ -8,7 +8,7 @@ const cron = require('node-cron');
let Hetzner = require('./Hetzner')
const cronRemover = require('node-cron');
const cronRemover2 = require('node-cron');
let _ = require('lodash')
const request = require('request');
const fs = require('fs')
const cronSpeed = require('node-cron');
......@@ -72,27 +72,25 @@ cronRemover.schedule(' */1 * * * *', () => {
});
cronRemover2.schedule(' */1 * * * *', () => {
init2()
});
async function init() {
await initToken()
await addIp()
try {
await attacher()
}
catch (e) {
}
async function init2() {
await initToken()
}
await remover()
}
async function checkIps(ip) {
......@@ -191,6 +189,7 @@ async function attacher() {
let serverId = await het.getMasterServerId()
serverId = parseInt(serverId)
let ips = await het.getAllFloatingIps()
ips=_.shuffle(ips)
let attached = false
for (let i = 0; i < ips.length; i++) {
if (typeof ips[i].server === "number") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment