You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@faulander You can try doing it this way. Write a custom app condition, which only schedules a function to run on Weekdays. Then use the condition while scheduling the task.
from rocketry import Rocketry
from rocketry.conds import time_of_day, every
from datetime import datetime
app = Rocketry()
WEEKDAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
@app.cond()
def is_week_day():
day = datetime.now().strftime("%A")
if day in WEEKDAYS:
return True
return False
@app.task(is_week_day & time_of_day.between("8:00", "20:00") & every("1 hours"))
def do_things():
...
if __name__ == "__main__":
app.run()
Describe the bug
Tasks with this task definition only run once
Expected behavior
task should run every day, every 10 minutes during 8am and 8pm
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: