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.
This commit is contained in:
Steve Howell 2016-08-11 06:43:58 -07:00 committed by Tim Abbott
parent b383f5ca5d
commit 5cd915694a

View File

@ -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