"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zaqar/storage/redis/utils.py" between
zaqar-9.0.0.tar.gz and zaqar-10.0.0.tar.gz

About: OpenStack Zaqar is a multi-tenant cloud messaging and notification service for web and mobile developers.
The "Ussuri" series (latest release).

utils.py  (zaqar-9.0.0):utils.py  (zaqar-10.0.0)
skipping to change at line 144 skipping to change at line 144
""" """
# Note(prashanthr_) : Try to reuse this utility. Violates DRY # Note(prashanthr_) : Try to reuse this utility. Violates DRY
# Can pass exception type into the decorator and create a # Can pass exception type into the decorator and create a
# storage level utility. # storage level utility.
@functools.wraps(func) @functools.wraps(func)
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
try: try:
return func(*args, **kwargs) return func(*args, **kwargs)
except redis.exceptions.ConnectionError as ex: except redis.exceptions.ConnectionError:
LOG.exception(ex) LOG.exception('Connection failure:')
raise errors.ConnectionError() raise errors.ConnectionError()
return wrapper return wrapper
def retries_on_connection_error(func): def retries_on_connection_error(func):
"""Causes the wrapped function to be re-called on ConnectionError. """Causes the wrapped function to be re-called on ConnectionError.
This decorator catches Redis ConnectionError and retries This decorator catches Redis ConnectionError and retries
the function call. the function call.
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)