Commits

Anonymous committed f724e71

added longer delay for syncdb on deploy

Comments (0)

Files changed (1)

management/commands/deploy.py

 # CHANGED: show warning if profiler is enabled, so you don't mistakenly upload
 # with non-production settings. Also, added --nosyncdb switch.
 
-import logging
-import time
-
 from django.conf import settings
 from django.core.management import call_command
 from django.core.management.base import BaseCommand
+import logging
+import sys
+import time
+
 
 def run_appcfg(argv):
     # We don't really want to use that one though, it just executes this one
 
     # Reset the logging level to WARN as appcfg will spew tons of logs on INFO
     logging.getLogger().setLevel(logging.WARN)
-    
+
     new_args = argv[:]
     new_args[1] = 'update'
     new_args.append('.')
     appcfg.main(new_args)
 
     if syncdb:
+        print 'Running syncdb.'
+        # Wait a little bit for deployment to finish
+        for countdown in range(9, 0, -1):
+            sys.stdout.write('%s\r' % countdown)
+            time.sleep(1)
         from django.db import connections
         for connection in connections.all():
             if hasattr(connection, 'setup_remote'):
                 connection.setup_remote()
-        print 'Running syncdb.'
-        # Wait a little bit for deployment to finish
-        time.sleep(2)
         call_command('syncdb', remote=True, interactive=True)
 
     if getattr(settings, 'ENABLE_PROFILER', False):