Selfcare fixes
This commit is contained in:
parent
3ae93be9ce
commit
2e036d5880
1 changed files with 12 additions and 10 deletions
|
@ -16,6 +16,7 @@ module.exports = {
|
|||
load: (b) => {
|
||||
b.sc_tasks = {}
|
||||
b.selfcareRun = 0
|
||||
b._client.on('login', () => {
|
||||
b.interval.sc = setInterval(() => {
|
||||
if (Date.now() - b.selfcareRun <= 600) {
|
||||
return
|
||||
|
@ -23,10 +24,11 @@ module.exports = {
|
|||
for (const i in b.sc_tasks) {
|
||||
if (b.sc_tasks[i].failed) {
|
||||
b.sc_tasks[i].failTask()
|
||||
}
|
||||
}
|
||||
b.selfcareRun = Date.now()
|
||||
}
|
||||
}
|
||||
}, 40)
|
||||
})
|
||||
b.add_sc_task = (name, failTask, startFailed) => {
|
||||
b.sc_tasks[name] = new SCTask(failTask, startFailed)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue