Commit 3144c98c by 李杨杨

添加超时,避免内存溢出

1 parent f9ac98f1
This file is too large to display.
...@@ -636,7 +636,7 @@ def recv_data(): ...@@ -636,7 +636,7 @@ def recv_data():
#交通过车 #交通过车
if vehicle_url != "": if vehicle_url != "":
try: try:
r = requests.post(url=vehicle_url,headers=headers,data=json.dumps(event_data)) r = requests.post(url=vehicle_url,headers=headers,data=json.dumps(event_data),timeout=30)
print "send trans restult---------:", r.status_code,r.content print "send trans restult---------:", r.status_code,r.content
status_code = r.status_code status_code = r.status_code
message = r.text message = r.text
...@@ -668,7 +668,7 @@ def recv_data(): ...@@ -668,7 +668,7 @@ def recv_data():
if illegal_url != "": if illegal_url != "":
try: try:
r = requests.post(url=illegal_url,headers=headers,data=json.dumps(event_data)) r = requests.post(url=illegal_url,headers=headers,data=json.dumps(event_data),timeout=30)
print "send illegal restult---------:", r.status_code print "send illegal restult---------:", r.status_code
status_code = r.status_code status_code = r.status_code
message = r.text message = r.text
...@@ -721,7 +721,7 @@ def recv_data(): ...@@ -721,7 +721,7 @@ def recv_data():
debug_writeFile(tflow_data_list, 'tflow_data_list.txt') debug_writeFile(tflow_data_list, 'tflow_data_list.txt')
if t_flow_url != "": if t_flow_url != "":
try: try:
r = requests.post(url=t_flow_url,headers=headers,data=json.dumps(tflow_data_list,ensure_ascii=False)) r = requests.post(url=t_flow_url,headers=headers,data=json.dumps(tflow_data_list,ensure_ascii=False),timeout=30)
print "send tflow restult---------:",r.status_code print "send tflow restult---------:",r.status_code
status_code = r.status_code status_code = r.status_code
message = r.text message = r.text
...@@ -781,7 +781,7 @@ def recv_data(): ...@@ -781,7 +781,7 @@ def recv_data():
if is_send: if is_send:
if event_url != "": if event_url != "":
try: try:
r = requests.post(url=event_url, headers=headers, data=json.dumps(event_data)) r = requests.post(url=event_url, headers=headers, data=json.dumps(event_data),timeout=30)
print "send event restult---------:", r.status_code print "send event restult---------:", r.status_code
status_code = r.status_code status_code = r.status_code
message = r.text message = r.text
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!