Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from voltron4lyfe/run_and_quit
Browse files Browse the repository at this point in the history
Add option to disable scheduling.
  • Loading branch information
MrZablah authored Nov 1, 2023
2 parents 9aee4a3 + f417d7f commit ec1961c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# The rest of the options are script specific
global:
run_now: true # If true it will run the script immediately, if false it will wait until the schedule_hour
schedule_hour: 4 # This is the hour of the day you want the script to run, it's based on a 24 hour clock and defaults to 4am
schedule_hour: 4 # This is the hour of the day you want the script to run, it's based on a 24 hour clock and defaults to 4am. Set to -1 to disable scheduling and quit after running.
log_level: info # log_level can be: debug, info, warning, error, critical
radarr:
# name is the name of the radarr instance, this is used to reference the instance in other scripts
Expand Down
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ async def main():
# Run tasks immediately (if run_now is True)
await run_tasks(config.run_now)

if int(config.schedule_hour == -1):
logger.debug("scheduling disabled. exit")
return

while True:
# Get the current time
now = datetime.now()
Expand Down

0 comments on commit ec1961c

Please sign in to comment.