Commit cd7b9ce2 authored by hujun's avatar hujun

1

parent c626d9ab
......@@ -84,7 +84,9 @@ class DownFile:
self.local.count_sleep = 0
for item in data:
if self.local.count_sleep >= 50:
self.lock.acquire()
self.log('sleep', '-----10s-----')
self.lock.release()
time.sleep(10)
self.local.count_sleep = 0
......@@ -105,7 +107,9 @@ class DownFile:
self.local.url = self.ali_yun_sdk(item['call_time'], item['call_id'])
self.local.is_ok = 0
except Exception as result:
self.lock.acquire()
self.log("exception 20s------------", str(result))
self.lock.release()
time.sleep(20)
self.local.is_ok = 1
......@@ -115,9 +119,11 @@ class DownFile:
self.local.count_sleep = self.local.count_sleep + 1 # 增加暂停计数
self.local.url = self.ali_yun_sdk(item['call_time'], item['call_id'])
except Exception as result:
self.lock.acquire()
self.log(
"two exception error-----call_time=" + item['call_time'] + '&call_id=' + item['call_id'],
str(result))
self.lock.release()
if len(self.local.url) == 0:
continue
......@@ -152,12 +158,11 @@ class DownFile:
self.lock.acquire()
self.download_num = self.download_num + 1
self.lock.release()
self.log('url', self.local.url)
self.log('download_file', self.local.result)
self.log("download_num", self.download_num)
self.log("old_num", self.old_num)
self.lock.release()
def download_remote(self, data):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment