File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 6767import socket
6868import logging
6969import optparse
70+ import platform as _platform
7071import warnings
7172import multiprocessing
7273
8182from celery.exceptions import ImproperlyConfigured
8283from celery.routes import Router
8384
85+ SYSTEM = _platform.system()
86+ IS_OSX = SYSTEM == "Darwin"
87+
8488STARTUP_INFO_FMT = """
8589Configuration ->
8690 . broker -> %(conninfo)s
@@ -303,6 +307,13 @@ def run_worker(self):
303307 max_tasks_per_child=self.max_tasks_per_child,
304308 task_time_limit=self.task_time_limit,
305309 task_soft_time_limit=self.task_soft_time_limit)
310+ self.install_platform_tweaks(worker)
311+ worker.start()
312+
313+ def install_platform_tweaks(self, worker):
314+ """Install platform specific tweaks and workarounds."""
315+ if IS_OSX:
316+ self.osx_proxy_detection_workaround()
306317
307318 # Install signal handler so SIGHUP restarts the worker.
308319 if not self._isatty:
@@ -313,7 +324,10 @@ def run_worker(self):
313324 install_worker_term_handler(worker)
314325 install_worker_int_handler(worker)
315326 signals.worker_init.send(sender=worker)
316- worker.start()
327+
328+ def osx_proxy_detection_workaround(self):
329+ """See http://github.com/ask/celery/issues#issue/161"""
330+ os.environ.setdefault("celery_dummy_proxy", "set_by_celeryd")
317331
318332
319333def install_worker_int_handler(worker):
You can’t perform that action at this time.
0 commit comments