3

詳細:https ://github.com/celery/celery/issues/3634

実行環境:

software -> celery:4.0.0 (latentcall) kombu:4.0.0 py:2.7.9
            billiard:3.5.0.2 redis:2.10.5
platform -> system:Darwin arch:64bit imp:CPython
loader   -> celery.loaders.app.AppLoader
settings -> transport:redis results:redis

sys: <module 'sys' (built-in)>
CELERYBEAT_SCHEDULE: {
    'coding.net': {   'schedule': datetime.timedelta(0, 30),
                      'task': 'coding_task.period_task'}}
BROKER_URL: u'redis://localhost:6379/0'
CELERY_RESULT_BACKEND: 'redis'
timedelta: <type 'datetime.timedelta'>

定期的なタスクを実行したい。実行中:celery -A coding_task worker --loglevel=info --concurrency=1およびcelery -A coding_task beatで、以下のエラーが発生しました:

[2016-12-01 12:12:36,419: INFO/MainProcess] Received task: coding_task.period_task[3a50e52d-3298-49d7-9cae-0aa0ada017a0]
[2016-12-01 12:12:36,420: ERROR/PoolWorker-1] Task coding_task.period_task[3a50e52d-3298-49d7-9cae-0aa0ada017a0] raised unexpected: AttributeError("'Process' object has no attribute '_authkey'",)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/celery/app/trace.py", line 368, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/celery/app/trace.py", line 623, in __protected_call__
    return self.run(*args, **kwargs)
  File "/Users/RaPoSpectre/PycharmProjects/RaPo3/task_dispatch/task/coding_task.py", line 16, in period_task
    crawl()
  File "/Users/RaPoSpectre/PycharmProjects/RaPo3/collector/collector/crawl_agent.py", line 33, in crawl
    crawler.crawl()
  File "/Users/RaPoSpectre/PycharmProjects/RaPo3/collector/collector/crawl_agent.py", line 24, in crawl
    p = Process(target=self._crawl)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 98, in __init__
    self._authkey = _current_process._authkey
AttributeError: 'Process' object has no attribute '_authkey' 

修正方法は?

ありがとう!

4

0 に答える 0