In the code below, I'm trying to hit an API and it takes about a minute to respond. The issue is that when I click on a button I get the warning symbol as seen in the attached image. How can I fix this?
Code snippet
new_url = []
for i in url1:
if i:
new_url.append(i)
else:
del new_url[-1]
url = ''.join(new_url)
print(url)
r = requests.get(url)
status = r.status_code
if str(status) == "500":
error = r.json()
msg2 = "" + error[ 'errorMessage' ] + "\n"
print(msg2)
send_Failureresponse_to_user(slack_client,channel,thread_ts,user_name,msg2)
else:
response = r.json()
msg = " Order Id - " + response[ 'orderId' ] + "\n First Name - " + response[ 'firstName' ] + "\n Last Name - " + response[
'lastName' ] + "\n PhoneNumber - " + response[ 'phoneNumber' ] + "\n Email - " + response[ 'emailAddress' ] + "\n"
print(msg)
user_threads_info[ user_name ][ 'orderId' ] = response[ 'orderId' ]
send_response_to_user(slack_client, channel, thread_ts, msg, user_name)
insert_values(channel, thread_ts, user_name)
# send_omsresponse_to_user(slack_client, channel, thread_ts)
return True