|
@@ -88,7 +88,7 @@ def irc_frontend(): |
|
|
logger.info("Starting IRC frontend") |
|
|
logger.info("Starting IRC frontend") |
|
|
frontend = Frontend() |
|
|
frontend = Frontend() |
|
|
|
|
|
|
|
|
if "wiki_schedule" in config.components: |
|
|
|
|
|
|
|
|
if config.components.get("wiki_schedule"): |
|
|
logger.info("Starting wiki scheduler") |
|
|
logger.info("Starting wiki scheduler") |
|
|
tasks.load() |
|
|
tasks.load() |
|
|
t_scheduler = threading.Thread(target=wiki_scheduler) |
|
|
t_scheduler = threading.Thread(target=wiki_scheduler) |
|
@@ -96,7 +96,7 @@ def irc_frontend(): |
|
|
t_scheduler.daemon = True |
|
|
t_scheduler.daemon = True |
|
|
t_scheduler.start() |
|
|
t_scheduler.start() |
|
|
|
|
|
|
|
|
if "irc_watcher" in config.components: |
|
|
|
|
|
|
|
|
if config.components.get("irc_watcher"): |
|
|
logger.info("Starting IRC watcher") |
|
|
logger.info("Starting IRC watcher") |
|
|
t_watcher = threading.Thread(target=irc_watcher, args=(frontend,)) |
|
|
t_watcher = threading.Thread(target=irc_watcher, args=(frontend,)) |
|
|
t_watcher.name = "irc-watcher" |
|
|
t_watcher.name = "irc-watcher" |
|
@@ -110,12 +110,12 @@ def irc_frontend(): |
|
|
f_conn.close() |
|
|
f_conn.close() |
|
|
|
|
|
|
|
|
def main(): |
|
|
def main(): |
|
|
if "irc_frontend" in config.components: |
|
|
|
|
|
|
|
|
if config.components.get("irc_frontend"): |
|
|
# Make the frontend run on our primary thread if enabled, and enable |
|
|
# Make the frontend run on our primary thread if enabled, and enable |
|
|
# additional components through that function: |
|
|
# additional components through that function: |
|
|
irc_frontend() |
|
|
irc_frontend() |
|
|
|
|
|
|
|
|
elif "wiki_schedule" in config.components: |
|
|
|
|
|
|
|
|
elif config.components.get("wiki_schedule"): |
|
|
# Run the scheduler on the main thread, but also run the IRC watcher on |
|
|
# Run the scheduler on the main thread, but also run the IRC watcher on |
|
|
# another thread iff it is enabled: |
|
|
# another thread iff it is enabled: |
|
|
logger.info("Starting wiki scheduler") |
|
|
logger.info("Starting wiki scheduler") |
|
@@ -128,7 +128,7 @@ def main(): |
|
|
t_watcher.start() |
|
|
t_watcher.start() |
|
|
wiki_scheduler() |
|
|
wiki_scheduler() |
|
|
|
|
|
|
|
|
elif "irc_watcher" in config.components: |
|
|
|
|
|
|
|
|
elif config.components.get("irc_watcher"): |
|
|
# The IRC watcher is our only enabled component, so run its function |
|
|
# The IRC watcher is our only enabled component, so run its function |
|
|
# only and don't worry about anything else: |
|
|
# only and don't worry about anything else: |
|
|
logger.info("Starting IRC watcher") |
|
|
logger.info("Starting IRC watcher") |
|
|