42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
import threading
|
|
|
|
from core.server.server import startServer
|
|
from core.execution.createthread import buildThread
|
|
from plugins.rmass.monitors import rmassmonitor
|
|
from plugins.rmass.actions import refresh_tokens
|
|
|
|
import login
|
|
|
|
lifecycles ={}
|
|
|
|
try:
|
|
lifecycles[rmassmonitor.name] = {}
|
|
lifecycles[rmassmonitor.name]["mode"] = "continuous"
|
|
thread, lifecycles = buildThread(rmassmonitor, lifecycles)
|
|
except ConnectionError:
|
|
print("Connection Error caught. Recovering")
|
|
pass
|
|
|
|
try:
|
|
lifecycles[refresh_tokens.name] = {}
|
|
lifecycles[refresh_tokens.name]["mode"] = "continuous"
|
|
thread, lifecycles = buildThread(refresh_tokens, lifecycles)
|
|
except ConnectionError:
|
|
print("Connection Error caught. Recovering")
|
|
pass
|
|
|
|
|
|
#lifecycles = {}
|
|
#try:
|
|
# lifecycles[rmassmonitor.name] = lifecycles
|
|
# lifecycles[rmassmonitor.name]["mode"] = "continuous"
|
|
# thread, lifecycles = buildThread(rmassmonitor, lifecycles)
|
|
#except ConnectionError:
|
|
# print("Connection Error caught. Recovering")
|
|
# pass
|
|
|
|
thread = threading.Thread(
|
|
target=startServer,
|
|
#args=(module, lifecycles)
|
|
)
|
|
thread.start() |