Skip to content

Commit

Permalink
adding wait_between_pages to slurp
Browse files Browse the repository at this point in the history
  • Loading branch information
eamonnfaherty committed Jun 22, 2021
1 parent d506e98 commit 4508bca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions betterboto/utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import logging
import time

logger = logging.getLogger(__file__)


def slurp(
name, func, response_to_concat,
next_token_name_in_response='NextPageToken', next_token_name_in_request='PageToken',
wait_between_pages=0,
**kwargs
):
logger.info("{}: {}".format(name, kwargs))
Expand All @@ -19,3 +21,4 @@ def slurp(
return response
else:
kwargs[next_token_name_in_request] = response.get(next_token_name_in_response)
time.sleep(wait_between_pages)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="better-boto",
version="0.39.0",
version="0.40.0",
author="Eamonn Faherty",
author_email="python-packages@designandsolve.co.uk",
description="Helpers to make using boto3 more enjoyable",
Expand Down

0 comments on commit 4508bca

Please sign in to comment.