python - Should I artificially slow down POSTing data -
i have python program runs on local machine, gathers information, , sends spring backend.
here python code sends information created in temp file
for line in dumpfile: line = line.strip("\n") sender = line.split("&") if sender[0] == 'none': sw_send_url = url + "/device/addprogram" data = { "customerid" : 1l, "deviceid" : device_id, "programname" : sender[1], "programversion" : "n/a" } response = requests.post(sw_send_url, data=data) if response.status_code != 200: exit(21) else: sw_send_url = url + "/device/addprogram" data = { "customerid": 1l, "deviceid": device_id, "programname": sender[0], "programversion": "n/a" } response = requests.post(sw_send_url, data=data) if response.status_code != 200: exit(21) time.sleep(0.1) #should here my question on time.sleep(). added avoid sending information fast wondering if sleep() method needs called? or spring server take care of make sure doesn't overwhelmed data? if needed amount of time sleep program for?
Comments
Post a Comment