Commits

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

i dont sure if its the better

  • Participants
  • Parent commits 044d78a

Comments (0)

Files changed (1)

File 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