|
@@ -1,14 +1,31 @@
|
|
|
#!/usr/bin/env python
|
|
|
import sys
|
|
|
- if not '' in sys.path:
|
|
|
-sys.path.insert(0, '')
|
|
|
-from celery.bin.celeryd import run_worker, parse_options
|
|
|
+if not '' in sys.path:
|
|
|
+ sys.path.insert(0, '')
|
|
|
+from celery.bin import celeryd
|
|
|
+
|
|
|
+WINDOWS_MESSAGE = """
|
|
|
+
|
|
|
+The celeryd command does not work on Windows.
|
|
|
+
|
|
|
+Instead, please use:
|
|
|
+
|
|
|
+ ..> python -m celery.bin.celeryd
|
|
|
+
|
|
|
+You can also supply arguments:
|
|
|
+
|
|
|
+ ..> python -m celery.bin.celeryd --concurrency=10 --loglevel=DEBUG
|
|
|
+
|
|
|
+
|
|
|
+"""
|
|
|
|
|
|
def main():
|
|
|
- import multiprocessing
|
|
|
- multiprocessing.freeze_support()
|
|
|
- options = parse_options(sys.argv[1:])
|
|
|
- run_worker(**vars(options))
|
|
|
+ if sys.platform == "win32":
|
|
|
+ print(WINDOWS_MESSAGE)
|
|
|
+ sys.exit()
|
|
|
+
|
|
|
+ options = celeryd.parse_options(sys.argv[1:])
|
|
|
+ celeryd.run_worker(**vars(options))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
main()
|