Swift logs: rename POST_RETRIES POST_ATTEMPTS

This more accurately describes this constant's usage.

Change-Id: I8fb6e1e6e776a9ec8b736b2a30327fbf56b49fc9
This commit is contained in:
James E. Blair 2018-07-31 07:15:08 -07:00
parent b6756077c8
commit 16c6a8a55a
1 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ mimetypes.init()
mimetypes.add_type('text/plain', '.yaml')
MAX_UPLOAD_THREADS = 24
POST_RETRIES = 3
POST_ATTEMPTS = 3
# Map mime types to apache icons
APACHE_MIME_ICON_MAP = {
@ -425,7 +425,7 @@ class Uploader(object):
headers['x-delete-after'] = str(self.delete_after)
headers['content-type'] = file_detail.mimetype
for attempt in range(1, POST_RETRIES + 1):
for attempt in range(1, POST_ATTEMPTS + 1):
try:
if not file_detail.folder:
if (file_detail.encoding is None and
@ -449,7 +449,7 @@ class Uploader(object):
except requests.exceptions.RequestException:
logging.exception(
"File posting error on attempt %d" % attempt)
if attempt >= POST_RETRIES:
if attempt >= POST_ATTEMPTS:
raise