Closed Bug 997299 Opened 8 years ago Closed 8 years ago

Create retry() context manager

Categories

(Release Engineering :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rail, Assigned: rail)

Details

Attachments

(1 file)

so we can use it like this:

import requests
from util.retry import retry_ctx

with retry_ctx(requests.get, attempts=5, sleeptime=60) as get:
    get("http://example.com")
Attachment #8407670 - Flags: review?(bhearsum)
Comment on attachment 8407670 [details] [diff] [review]
retry-tools-1.diff

Review of attachment 8407670 [details] [diff] [review]:
-----------------------------------------------------------------

This is wonderful.
Attachment #8407670 - Flags: review?(bhearsum) → review+
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Component: General Automation → General
You need to log in before you can comment on or make changes to this bug.