projects
/
arvados.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f45f76
)
3147: Add retry support to PySDK list_all utility.
author
Brett Smith <brett@curoverse.com>
Mon, 15 Sep 2014 15:21:31 +0000
(11:21 -0400)
committer
Brett Smith <brett@curoverse.com>
Thu, 18 Sep 2014 19:51:48 +0000
(15:51 -0400)
sdk/python/arvados/util.py
patch
|
blob
|
history
diff --git
a/sdk/python/arvados/util.py
b/sdk/python/arvados/util.py
index ada1aec6eff677f795c406785bc84129fb75cb2e..2609f112fe31d050a5a1db094e32ca8087774c5c 100644
(file)
--- a/
sdk/python/arvados/util.py
+++ b/
sdk/python/arvados/util.py
@@
-338,12
+338,12
@@
def is_hex(s, *length_args):
good_len = True
return bool(good_len and HEX_RE.match(s))
-def list_all(fn, **kwargs):
+def list_all(fn,
num_retries=0,
**kwargs):
items = []
offset = 0
items_available = sys.maxint
while len(items) < items_available:
- c = fn(offset=offset, **kwargs).execute()
+ c = fn(offset=offset, **kwargs).execute(
num_retries=num_retries
)
items += c['items']
items_available = c['items_available']
offset = c['offset'] + len(c['items'])