Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
f00f
Geike
Commits
68b20486
Verified
Commit
68b20486
authored
Mar 09, 2021
by
Luc Everse
Browse files
Add a SIGTERM handler
parent
aeb55309
Pipeline
#1756
passed with stage
in 5 minutes and 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
geike2.js
View file @
68b20486
import
fs
from
'
fs
'
;
import
fsPromises
from
'
fs/promises
'
;
import
process
from
'
process
'
;
import
Discord
from
'
discord.js
'
;
import
ssdeep
from
'
ssdeep.js
'
;
import
{
parseISO
}
from
'
date-fns
'
;
...
...
@@ -132,7 +133,14 @@ client.on('ready', () => {
logger
.
log
(
`Logged in as
${
client
.
user
.
tag
}
!`
);
cw
.
start
();
setInterval
(()
=>
storeConfig
(
config
),
15000
);
const
storeConfigTimer
=
setInterval
(()
=>
storeConfig
(
config
),
15000
);
process
.
on
(
'
SIGTERM
'
,
()
=>
{
clearInterval
(
storeConfigTimer
);
cw
.
stop
();
client
.
destroy
();
process
.
exit
();
});
});
client
.
login
(
config
.
loginToken
).
catch
(
console
.
error
);
Write
Preview
Supports
Markdown
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