Commits

Ginés Martínez Sánchez committed 39426b9

i dont sure if its the better

Comments (0)

Files changed (1)

ginsfsm/gaplic.py

     threads = local_conf.get('threads', '').split()
     subprocesses = local_conf.get('subprocesses', '').split()
 
+    # Firstly create main gaplic, to pass it to wsgi's
+    main_gaplic = loader.get_app(main, global_conf=global_conf)
+    set_global_main_gaplic(main_gaplic)
+    global_conf.update({'main_gaplic': main_gaplic})
+
     for wsgi in wsgis:
         app = loader.get_app(wsgi, global_conf=global_conf)
         set_global_app(wsgi, app)
 
-    gaplic_main = loader.get_app(main, global_conf=global_conf)
-    set_global_main_gaplic(gaplic_main)
-
     for thread in threads:
         gaplic = loader.get_app(thread, global_conf=global_conf)
         worker = GAplicThreadWorker(gaplic)
         worker = GAplicProcessWorker(gaplic)
         worker.start()
 
-    return gaplic_main
+    return main_gaplic