Answer the question
In order to leave comments, you need to log in
How to deal with repeated GET request?
Every minute to the server, I send a get request. I
process it like this
def in_work():
response_work = requests.get(url + param + work, verify=False)
response_work.encoding = "utf-8"
data_work = response_work.json()
print(url + param + work)
for x in data_work:
for y in x["data"]:
if y["status"] in ["27047"]:
Change_w = requests.get(
url1 + '27047')
Change_w.encoding = "utf-8
Answer the question
In order to leave comments, you need to log in
Can! Install redis. Push status into it with TTL equal to two minutes.
First check if redis has a status value and return it either from the redis or via a query.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question