Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
Hetzner-NewGeneration
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Hetzner-NewGeneration
Commits
79fcb898
Commit
79fcb898
authored
Apr 20, 2020
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
5caa1367
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
app.js
app.js
+9
-10
No files found.
app.js
View file @
79fcb898
...
...
@@ -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
()
await
attacher
()
}
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
"
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment