dimagi/dimagi-utils — pull request #1 by dmyung (2012-09-16 23:29:10+00:00)
Title: Multi sync management command

new management command sync_prepare_couchdb_multi (moved from corehq)

requires gevent, optional gitpython for current checkout info summary.

python manage.py sync_prepare_couchdb_multi

both args optional, defaults to 4, username hard codes to email to commcarehq-dev@dimagi.com on results.

this took a bit longer to get working due to exceptions being thrown on long running reindex tasks (see: reports). I believe the exceptions happen due to COUCHDB_TIMEOUT which is defaulted to 5 minutes. I don't want to have to expand the timeout for long running tasks running away, so I had to add a secondary checker using the server's active_tasks feed and force the number of workers to be below that.