Miksus / rocketry

Modern scheduling library for Python
https://rocketry.readthedocs.io
MIT License
3.28k stars 108 forks source link

@app.task('daily.at("21:00") before Friday') #191

Open faulander opened 1 year ago

faulander commented 1 year ago

Describe the bug above statements results in rocketry.parse.utils.exception.ParserError: Could not find parser for string 'daily.at'. To Reproduce Steps to reproduce the behavior.

Expected behavior Statement should run every MO,TUE,WED,THUR,FRI at 21:00

Desktop (please complete the following information):

carlosporta commented 1 year ago

You are not using the starting condition correctly. daily.at must be a function not a string.

from rocketry import Rocketry
from rocketry.conds import daily, weekly

app = Rocketry()

@app.task(daily.at('21:00') & weekly.before('Friday'))
def do_daily():
    print('hi')

if __name__ == '__main__':
    app.run()