scheduled function
Closed this issue · 1 comments
guldo111 commented
Hey
i'm creating a scheduled function with python sdk, but i receive this error:
TypeError: Inngest.create_function() got an unexpected keyword argument 'cron'
this is the code i am using:
import inngest
inngest_client = inngest.Inngest(
app_id="my_app",
is_production=os.getenv("INNGEST_DEV") is None,
)
@inngest_client.create_function(
fn_id="my_function",
cron="0 8 * * *"
)
does python sdk support cron? or am i doing something wrong?
thanks
goodoldneon commented
It supports crons! You'll need to use the inngest.TriggerCron
class:
import inngest
inngest_client = inngest.Inngest(
app_id="my_app",
)
@inngest_client.create_function(
fn_id="my_function",
trigger=inngest.TriggerCron(cron="0 8 * * *")
)
Also, is there reason why you're setting is_production=os.getenv("INNGEST_DEV") is None
on the client? The INNGEST_DEV
env var should be automatic