forked from Firepup650/FireBot
Add logging for checkups, and increase delay between checks
This commit is contained in:
parent
eb43698ff3
commit
2a9e3a7aea
1 changed files with 3 additions and 2 deletions
5
core.py
5
core.py
|
@ -21,7 +21,7 @@ def is_dead(thr):
|
||||||
thr.join(timeout=0)
|
thr.join(timeout=0)
|
||||||
return not thr.is_alive()
|
return not thr.is_alive()
|
||||||
|
|
||||||
def start():
|
def start(server):
|
||||||
t = Thread(target=launch, args=(server,))
|
t = Thread(target=launch, args=(server,))
|
||||||
t.daemon = True
|
t.daemon = True
|
||||||
t.start()
|
t.start()
|
||||||
|
@ -33,7 +33,8 @@ if __name__ == "__main__":
|
||||||
threads[server] = start(server)
|
threads[server] = start(server)
|
||||||
print("[LOG][CORE] Started all instances. Idling...")
|
print("[LOG][CORE] Started all instances. Idling...")
|
||||||
while 1:
|
while 1:
|
||||||
sleep(10)
|
sleep(60)
|
||||||
|
print("[LOG][CORE] Running a checkup on all running instances")
|
||||||
for server in threads:
|
for server in threads:
|
||||||
t = threads[server]
|
t = threads[server]
|
||||||
if is_dead(t):
|
if is_dead(t):
|
||||||
|
|
Loading…
Reference in a new issue