diff --git a/zerver/lib/export.py b/zerver/lib/export.py index eca4f43104..2a2d983f98 100644 --- a/zerver/lib/export.py +++ b/zerver/lib/export.py @@ -600,7 +600,13 @@ def do_export_realm(realm, output_dir, threads): logging.info("Exporting messages") export_messages(realm, user_profile_ids, recipient_ids, output_dir=output_dir) - # Start parallel jobs to export the UserMessage objects + # Start parallel jobs to export the UserMessage objects. + launch_user_message_subprocesses(threads=threads, output_dir=output_dir) + + logging.info("Finished exporting %s" % (realm.domain)) + +def launch_user_message_subprocesses(threads, output_dir): + # type: (int, Path) -> None logging.info('Launching %d PARALLEL subprocesses to export UserMessage rows' % (threads,)) def run_job(shard): # type: (str) -> int @@ -613,8 +619,6 @@ def do_export_realm(realm, output_dir, threads): threads=threads): print("Shard %s finished, status %s" % (job, status)) - logging.info("Finished exporting %s" % (realm.domain)) - def do_export_user(user_profile, output_dir): # type: (UserProfile, Path) -> None response = {} # type: TableData