mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-11-09 15:32:23 +01:00
Update scheduler.py
This commit is contained in:
1 parent
8b54c52e7f
commit
41e7c1207a
1 file changed
+3
-1
@@ -5,7 +5,7 @@ import schedule
|
||||
from datetime import datetime
|
||||
from functools import partial
|
||||
from modules.log import logger
|
||||
from modules.settings import MOTD
|
||||
from modules.settings import MOTD, schedulerChannel, schedulerInterface, schedulerMessage, schedulerMotd, schedulerTime, schedulerInterval, schedulerValue
|
||||
from modules.system import send_message
|
||||
|
||||
async def run_scheduler_loop(interval=1):
|
||||
@@ -107,8 +107,10 @@ def setup_scheduler(
|
||||
if any(option in schedulerValue for option in basicOptions):
|
||||
if schedulerValue == 'day':
|
||||
if schedulerTime:
|
||||
# Specific time each day
|
||||
schedule.every().day.at(schedulerTime).do(send_sched_msg)
|
||||
else:
|
||||
# Every N days
|
||||
schedule.every(schedulerIntervalInt).days.do(send_sched_msg)
|
||||
elif 'mon' in schedulerValue and schedulerTime:
|
||||
schedule.every().monday.at(schedulerTime).do(send_sched_msg)
|
||||
|
||||
Reference in new issue
Block a user