From 5cd915694a189df3489fb2d5e9decabba65e8cc6 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 11 Aug 2016 06:43:58 -0700 Subject: [PATCH] export: Extract launch_user_message_subprocesses(). This is the last in a series of commits that makes it so that do_export_realm() mostly delegates work out to other functions. --- zerver/lib/export.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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