For function-based tasks, you can adjust the number of times a task should be retried by setting the retries and retry_delay_seconds keyword arguments to the @task decorator:
retries: the number of times the task should be retried. Default is 0.
retry_delay_seconds: the number of seconds to wait in between retries. Must be specified alongside retries. Default is 0.