Skip to content

@app.schedule No longer supports Rate/Cron object expression #1967

Closed
@dhay

Description

@dhay

A recent commit (afd23d7), added types to the various decorators. In particular, the @app.schedule decorator requires expression to be a str, which means that it no longer accepts the object type Rate or Cron.

I used to be able to do this (and the Chalice documentation shows this example as well)

@app.schedule(Rate(1, unit=Rate.HOURS), name=f"send_call_reminders-{ENV}")

Now, I have to add a to_string() call as follows:

@app.schedule(Rate(1, unit=Rate.HOURS).to_string(), name=f"send_call_reminders-{ENV}")

I'm thinking the type for the schedule decorator should probably be Union[str, ScheduleExpression].

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions