Permalink
Browse files

Move datastore flush handler so it's not used in production.

  • Loading branch information...
User
User committed Apr 9, 2012
1 parent cc9fbda commit a6a493b23169338123e0ffa8543a2e2cd00f17bb
Showing with 7 additions and 7 deletions.
  1. +7 −7 boot.py
View
14 boot.py
@@ -157,6 +157,13 @@ def setup_project():
logging.warn('Could not patch modules whitelist. '
'The compiler and parser modules will not work and '
'SSL support is disabled.')
# In SDK 1.6.4, the datastore doesn't save automatically on exit.
# Register a handler to make sure we save. This is important on
# manage.py commands other than 'runserver'. Note that with runserver,
# the datastore is flushed twice. This should be acceptable.
import atexit
if hasattr(dev_appserver, 'TearDownStubs'):
atexit.register(dev_appserver.TearDownStubs)
elif not on_production_server:
try:
# Restore the real subprocess module
@@ -189,10 +196,3 @@ def setup_project():
sys.path.remove(path)
sys.path = extra_paths + sys.path
# In SDK 1.6.4, the datastore doesn't save automatically on exit.
# Register a handler to make sure we save. This is important on
# manage.py commands other than 'runserver'. Note that with runserver,
# the datastore is flushed twice. This should be acceptable.
import atexit
if hasattr(dev_appserver, 'TearDownStubs'):
atexit.register(dev_appserver.TearDownStubs)

0 comments on commit a6a493b

Please sign in to comment.