mirror of
https://github.com/bugsink/bugsink.git
synced 2025-12-30 18:00:17 -06:00
Push get_pc_registry into snappea.foreman init
This commit is contained in:
@@ -118,6 +118,13 @@ class Foreman:
|
||||
# stops. (the value of this semaphore is implicitly NUM_WORKERS - active_workers)
|
||||
self.worker_semaphore = threading.Semaphore(self.settings.NUM_WORKERS)
|
||||
|
||||
# "initialize" the application.
|
||||
# this is likely in the wrong place, but I want to have it "somewhere" (before the workers start). And thinking
|
||||
# of the right place is something I want to postpone (it's also something we need to do for gunicorn, where it's
|
||||
# even harder because multi-process means the n (number of workers) don't share the same instance.
|
||||
from bugsink.registry import get_pc_registry
|
||||
get_pc_registry()
|
||||
|
||||
def run_in_thread(self, task_id, function, *args, **kwargs):
|
||||
# NOTE: we expose args & kwargs in the logs; as it stands no sensitive stuff lives there in our case, but this
|
||||
# is something to keep an eye on
|
||||
|
||||
Reference in New Issue
Block a user