--- a/src/pyams_scheduler/include.py Thu Aug 27 11:43:05 2015 +0200
+++ b/src/pyams_scheduler/include.py Thu Oct 08 11:12:35 2015 +0200
@@ -60,6 +60,7 @@
# get application
application_name = settings.get(PYAMS_APPLICATION_SETTINGS_KEY, PYAMS_APPLICATION_DEFAULT_NAME)
application = root.get(application_name)
+ process = None
if application is not None:
sm = application.getSiteManager()
set_local_registry(sm)
@@ -89,7 +90,7 @@
if process.is_alive():
atexit.register(process_exit_func, process=process)
finally:
- if not process.is_alive():
+ if process and not process.is_alive():
process.terminate()
process.join()
set_local_registry(None)