Asynchronous push_to_storage for files and images
This commit is contained in:
parent
55b17403f5
commit
f2ac8e48e3
@ -199,7 +199,9 @@ def process_file(src_file):
|
|||||||
if mime_type != 'video':
|
if mime_type != 'video':
|
||||||
# Sync the whole subdir
|
# Sync the whole subdir
|
||||||
sync_path = os.path.split(file_abs_path)[0]
|
sync_path = os.path.split(file_abs_path)[0]
|
||||||
push_to_storage(str(src_file['project']), sync_path)
|
# push_to_storage(str(src_file['project']), sync_path)
|
||||||
|
p = Process(target=push_to_storage, args=(str(src_file['project']), sync_path))
|
||||||
|
p.start()
|
||||||
else:
|
else:
|
||||||
sync_path = file_abs_path
|
sync_path = file_abs_path
|
||||||
|
|
||||||
|
@ -75,7 +75,6 @@ def push_to_storage(project_id, full_path, backend='cgs'):
|
|||||||
for root, dirs, files in os.walk(full_path):
|
for root, dirs, files in os.walk(full_path):
|
||||||
for name in files:
|
for name in files:
|
||||||
push_single_file(project_id, os.path.join(root, name), backend)
|
push_single_file(project_id, os.path.join(root, name), backend)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise IOError('ERROR: path not found')
|
raise IOError('ERROR: path not found')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user