1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-16 16:21:48 +00:00

fix export sdoc bug (#6773)

This commit is contained in:
JoinTyang 2024-09-13 18:04:39 +08:00 committed by GitHub
parent 8ff9475196
commit 3dae590dfc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,7 @@ import shutil
import requests import requests
from zipfile import ZipFile, is_zipfile from zipfile import ZipFile, is_zipfile
from seaserv import seafile_api from seaserv import seafile_api, USE_GO_FILESERVER
from seahub.tags.models import FileUUIDMap from seahub.tags.models import FileUUIDMap
from seahub.settings import SEADOC_PRIVATE_KEY from seahub.settings import SEADOC_PRIVATE_KEY
@ -351,13 +351,14 @@ def export_sdoc_prepare_images_folder(repo_id, doc_uuid, images_dir_id, username
except Exception as e: except Exception as e:
raise e raise e
progress = {'zipped': 0, 'total': 1} if not USE_GO_FILESERVER:
while progress['zipped'] != progress['total']: progress = {'zipped': 0, 'total': 1}
time.sleep(0.5) # sleep 0.5 second while progress['zipped'] != progress['total']:
try: time.sleep(0.5) # sleep 0.5 second
progress = json.loads(seafile_api.query_zip_progress(token)) try:
except Exception as e: progress = json.loads(seafile_api.query_zip_progress(token))
raise e except Exception as e:
raise e
asset_url = '%s/zip/%s' % (get_inner_fileserver_root(), token) asset_url = '%s/zip/%s' % (get_inner_fileserver_root(), token)
try: try: