def verify_app_log_cur_day2(self, anypoint_monitoring, organization_id, int, applist, access_token):
headers = {"Authorization": f"Bearer {access_token}"}
payload = {}
log_list = []
for item in applist:
url = f"{anypoint_monitoring}/organizations/{organization_id}/environments/{int}/applications/{item}/logs}"
response = requests.request("GET", url, headers=headers, data=payload)
if response.status_code == 503:
continue
else:
log_list.append([response.json()])
return log_list
如何为代码添加功能?
- 如果响应状态代码== 503,则重试
- 如果响应状态代码再次== 503,则继续
1条答案
按热度按时间cyvaqqii1#
只需这样做