fishyboteso/fishy/helper/active_poll.py
Adam Saudagar a12c397357 instead of restarting fishy when session is not created due to incorrect uid, re generate uid and try to create session again
removed restart from debug options (fishy should always exit safely)
added debug logs for when systems start and stop
update button from tool bar now opens update dialogue correctly
2022-02-03 03:47:35 +05:30

29 lines
662 B
Python

import logging
from event_scheduler import EventScheduler
from fishy.web import web
# noinspection PyPep8Naming
class active:
_scheduler: EventScheduler = None
@staticmethod
def init():
if active._scheduler:
return
active._scheduler = EventScheduler()
active._scheduler.start()
logging.debug("active scheduler initialized")
@staticmethod
def start():
active._scheduler.enter_recurring(60, 1, web.ping)
logging.debug("active scheduler started")
@staticmethod
def stop():
active._scheduler.stop(hard_stop=True)
logging.debug("active scheduler stopped")