def get_box_folder(client, cur_box_folder, folder_id, retry_limit):
"""
:param client:
:param cur_box_folder:
:param folder_id:
:param retry_limit:
:return:
"""
for i in range(retry_limit):
try:
box_folder = client.folder(folder_id=folder_id).get()
cur_box_folder = box_folder
break
except (ConnectionError, BrokenPipeError, ProtocolError, ConnectionResetError, BoxAPIException):
if i + 1 >= retry_limit:
crate_logger.warn('Attempt ({retry_count}) out of ({max_count}); Going to give '
'up on the write event because: {trace}'.format(retry_count=i,
max_count=retry_limit,
trace=traceback.format_exc()))
else:
crate_logger.warn('Attempt ({retry_count}) '
'out of ({max_count}): {trace}'.format(retry_count=i,
max_count=retry_limit,
trace=traceback.format_exc()))
return cur_box_folder
评论列表
文章目录