コード例 #1
0
ファイル: __init__.py プロジェクト: kornholi/celery
def process_initializer(app, hostname):
    """Initializes the process so it can be used to process tasks.

    Used for multiprocessing environments.

    """
    app = app_or_default(app)
    app.set_current()
    platforms.reset_signal(*WORKER_SIGRESET)
    platforms.ignore_signal(*WORKER_SIGIGNORE)
    platforms.set_mp_process_title("celeryd", hostname=hostname)

    # This is for Windows and other platforms not supporting
    # fork(). Note that init_worker makes sure it's only
    # run once per process.
    app.loader.init_worker()

    signals.worker_process_init.send(sender=None)
コード例 #2
0
ファイル: __init__.py プロジェクト: flaper87/celery
def process_initializer(app, hostname):
    """Initializes the process so it can be used to process tasks.

    Used for multiprocessing environments.

    """
    app = app_or_default(app)
    [platforms.reset_signal(signal) for signal in WORKER_SIGRESET]
    [platforms.ignore_signal(signal) for signal in WORKER_SIGIGNORE]
    platforms.set_mp_process_title("celeryd", hostname=hostname)

    # This is for windows and other platforms not supporting
    # fork(). Note that init_worker makes sure it's only
    # run once per process.
    app.loader.init_worker()

    signals.worker_process_init.send(sender=None)
コード例 #3
0
ファイル: beat.py プロジェクト: hekevintran/celery
 def run(self):
     platforms.reset_signal("SIGTERM")
     self.service.start(embedded_process=True)
コード例 #4
0
ファイル: beat.py プロジェクト: kornholi/celery
 def run(self):
     platforms.reset_signal("SIGTERM")
     self.service.start(embedded_process=True)