Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bot/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class BotConfig(ConfigHelper):
"light_device",
"upload_path",
"services",
"start_delay",
]

def __init__(self, config: configparser.ConfigParser):
Expand All @@ -218,6 +219,7 @@ def __init__(self, config: configparser.ConfigParser):
self.upload_path: str = self._get_str("upload_path", default="")
self.services: List[str] = self._get_list("services", default=["klipper", "moonraker"])
self.log_parser: bool = self._get_boolean("log_parser", default=False)
self.start_delay: int = self._get_int("start_delay", default=1)

host_parts = self.host.split(":")
if len(host_parts) == 2 and host_parts[1].isdigit():
Expand Down
2 changes: 1 addition & 1 deletion bot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ async def start_scheduler(context: ContextTypes.DEFAULT_TYPE):

ws_helper = WebSocketHelper(configWrap, klippy, notifier, timelapse, a_scheduler, rotating_handler)

bot_updater.job_queue.run_once(start_scheduler, 1)
bot_updater.job_queue.run_once(start_scheduler, configWrap.bot_config.start_delay)
bot_updater.run_polling(allowed_updates=Update.ALL_TYPES)

logger.info("Shutting down the bot")