Skip to content

Commit

Permalink
Change to retry_delay 10 sec in tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeil committed Feb 10, 2020
1 parent 64431bf commit 2c1d409
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/core/tutorial/04-handling-failure.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ import aircraftlib as aclib
from prefect import task, Flow, Parameter
@task(max_retries=3, retry_delay=timedelta(seconds=1))
@task(max_retries=3, retry_delay=timedelta(seconds=10))
def extract_reference_data():
# same as before ...
...
@task(max_retries=3, retry_delay=timedelta(seconds=1))
@task(max_retries=3, retry_delay=timedelta(seconds=10))
def extract_live_data(airport, radius, ref_data):
# same as before ...
...
```

This is a simple measure that helps our `Flow` gracefully handle transient errors in only the tasks we specify. Now if there are any failed web requests, a maximum of 3 attempts will be made, waiting 1 second between each attempt.
This is a simple measure that helps our `Flow` gracefully handle transient errors in only the tasks we specify. Now if there are any failed web requests, a maximum of 3 attempts will be made, waiting 10 seconds between each attempt.

::: tip More Ways to Handle Failures

Expand Down
4 changes: 2 additions & 2 deletions examples/tutorial/04_handle_failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from prefect import task, Flow, Parameter


@task(max_retries=3, retry_delay=timedelta(seconds=1))
@task(max_retries=3, retry_delay=timedelta(seconds=10))
def extract_reference_data():
print("fetching reference data...")
return aclib.fetch_reference_data()


@task(max_retries=3, retry_delay=timedelta(seconds=1))
@task(max_retries=3, retry_delay=timedelta(seconds=10))
def extract_live_data(airport, radius, ref_data):
# Get the live aircraft vector data around the given airport (or none)
area = None
Expand Down

0 comments on commit 2c1d409

Please sign in to comment.