Browse Source

Closes #68: don't start daemons when gearbox commands

Bastien Sevajol (Algoo) 8 years ago
parent
commit
cdceb5a995
2 changed files with 8 additions and 1 deletions
  1. 3 1
      tracim/tracim/command/__init__.py
  2. 5 0
      tracim/tracim/config/app_cfg.py

+ 3 - 1
tracim/tracim/command/__init__.py View File

58
         sys.path.insert(0, here_dir)
58
         sys.path.insert(0, here_dir)
59
 
59
 
60
         # Load the wsgi app first so that everything is initialized right
60
         # Load the wsgi app first so that everything is initialized right
61
-        wsgi_app = loadapp(config_name, relative_to=here_dir)
61
+        wsgi_app = loadapp(config_name, relative_to=here_dir, global_conf={
62
+            'disable_daemons': 'true',
63
+        })
62
         test_app = TestApp(wsgi_app)
64
         test_app = TestApp(wsgi_app)
63
 
65
 
64
         # Make available the tg.request and other global variables
66
         # Make available the tg.request and other global variables

+ 5 - 0
tracim/tracim/config/app_cfg.py View File

94
     """
94
     """
95
     Sart Tracim daemons
95
     Sart Tracim daemons
96
     """
96
     """
97
+    from tg import config
98
+    # Don't start daemons if they are disabled
99
+    if 'disable_daemons' in config and config['disable_daemons']:
100
+        return
101
+
97
     manager.run('radicale', RadicaleDaemon)
102
     manager.run('radicale', RadicaleDaemon)
98
 
103
 
99
 environment_loaded.register(lambda: start_daemons(daemons))
104
 environment_loaded.register(lambda: start_daemons(daemons))