Skip to content

Commit

Permalink
refactor(examples): update examples to use new time unit
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non committed Jan 2, 2017
1 parent f530143 commit 439d14a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ You can see more featured examples from the `documentation` site.
def task():
"""Retry operation if it fails using exponential backoff"""
@riprova.retry(timeout=10 * 1000)
@riprova.retry(timeout=10)
def task():
"""Raises a TimeoutError if the retry loop exceeds from 10 seconds"""
Expand Down
2 changes: 1 addition & 1 deletion examples/constant_backoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


# Register retriable operation with custom evaluator
@riprova.retry(backoff=riprova.ConstantBackoff(interval=500, retries=retries))
@riprova.retry(backoff=riprova.ConstantBackoff(interval=.5, retries=retries))
def mul2(x):
global calls

Expand Down
4 changes: 2 additions & 2 deletions examples/showcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
def task():
"""Retry operation if it fails with constant backoff"""

@riprova.retry(backoff=riprova.ExponentialBackOff(factor=0.5))
@riprova.retry(backoff=riprova.ExponentialBackOff(factor=.5))
def task():
"""Retry operation if it fails using exponential backoff"""

@riprova.retry(timeout=10000)
@riprova.retry(timeout=10)
def task():
"""Raises a TimeoutError if the retry loop exceeds from 10 seconds"""

Expand Down
2 changes: 1 addition & 1 deletion examples/timeout_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


# Register retriable operation with custom evaluator
@riprova.retry(timeout=300)
@riprova.retry(timeout=0.3)
def mul2(x):
global calls

Expand Down

0 comments on commit 439d14a

Please sign in to comment.