Commit f849aae0 authored by hujun's avatar hujun

1

parent 3b65aba5
...@@ -25,7 +25,6 @@ class DownFile: ...@@ -25,7 +25,6 @@ class DownFile:
self.save_path = save_path self.save_path = save_path
self.page_string = page_string self.page_string = page_string
self.call_date_string = call_date_string self.call_date_string = call_date_string
self.lock = threading.Lock()
@staticmethod @staticmethod
def ali_yun_sdk(call_time, call_id): def ali_yun_sdk(call_time, call_id):
...@@ -90,9 +89,6 @@ class DownFile: ...@@ -90,9 +89,6 @@ class DownFile:
if len(item['voice_file']) > 0: if len(item['voice_file']) > 0:
local_file = self.save_path + item['voice_file'] local_file = self.save_path + item['voice_file']
if self.check_file(local_file): if self.check_file(local_file):
self.lock.acquire()
self.old_num = self.old_num + 1
self.lock.release()
continue continue
time_array = time.strptime(item['call_time'], '%Y-%m-%d %H:%M:%S') time_array = time.strptime(item['call_time'], '%Y-%m-%d %H:%M:%S')
...@@ -140,22 +136,13 @@ class DownFile: ...@@ -140,22 +136,13 @@ class DownFile:
continue continue
if self.check_file(local_file): if self.check_file(local_file):
self.lock.acquire()
self.old_num = self.old_num + 1
self.lock.release()
continue continue
self.check_dir(self.save_path + local_dir) self.check_dir(self.save_path + local_dir)
result = request.urlretrieve(url, local_file) result = request.urlretrieve(url, local_file)
self.lock.acquire()
self.download_num = self.download_num + 1
self.lock.release()
self.log('url', url) self.log('url', url)
self.log('download_file', result) self.log('download_file', result)
self.log("download_num", self.download_num)
self.log("old_num", self.old_num)
def download_remote(self, data): 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