diff options
Diffstat (limited to 'library/vkapi.py')
-rw-r--r-- | library/vkapi.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/vkapi.py b/library/vkapi.py index 20ff06c..6c54116 100644 --- a/library/vkapi.py +++ b/library/vkapi.py @@ -53,7 +53,7 @@ except ImportError: logger.warning("vkapi: ujson wasn't loaded, using simplejson instead") -def attemptTo(maxRetries, resultType, *errors): +def repeat(maxRetries, resultType, *errors): """ Tries to execute function ignoring specified errors specified number of times and returns specified result type on try limit. @@ -110,7 +110,7 @@ class AsyncHTTPRequest(httplib.HTTPSConnection): self.headers = headers or {} self.created = time.time() - @attemptTo(REQUEST_RETRIES, None, *ERRORS) + @repeat(REQUEST_RETRIES, None, *ERRORS) def open(self): self.connect() self.request(("POST" if self.data else "GET"), self.url, self.data, @@ -193,7 +193,7 @@ class RequestProcessor(object): request = urllib2.Request(url, data, headers) return request - @attemptTo(REQUEST_RETRIES, tuple, *ERRORS) + @repeat(REQUEST_RETRIES, tuple, *ERRORS) def post(self, url, data=None, urlencode=True): """ POST request |