Selfcare fixes
This commit is contained in:
parent
3ae93be9ce
commit
2e036d5880
1 changed files with 12 additions and 10 deletions
|
@ -16,17 +16,19 @@ module.exports = {
|
|||
load: (b) => {
|
||||
b.sc_tasks = {}
|
||||
b.selfcareRun = 0
|
||||
b.interval.sc = setInterval(() => {
|
||||
if (Date.now() - b.selfcareRun <= 600) {
|
||||
return
|
||||
}
|
||||
for (const i in b.sc_tasks) {
|
||||
if (b.sc_tasks[i].failed) {
|
||||
b.sc_tasks[i].failTask()
|
||||
b._client.on('login', () => {
|
||||
b.interval.sc = setInterval(() => {
|
||||
if (Date.now() - b.selfcareRun <= 600) {
|
||||
return
|
||||
}
|
||||
}
|
||||
b.selfcareRun = Date.now()
|
||||
}, 40)
|
||||
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