def get_folder(client, folder_id):
"""
:param client:
:param folder_id:
:return:
"""
folder = None
num_retry = 15
for x in range(num_retry):
try:
folder = client.folder(folder_id=folder_id).get()
break
except (ConnectionError, BrokenPipeError, ProtocolError, ConnectionResetError, BoxAPIException):
crate_logger.debug(traceback.format_exc())
if x >= num_retry - 1:
crate_logger.debug('Failed for the last time to get the folder: {}'.format(folder_id))
return folder
评论列表
文章目录