芹菜工作没有在设定的时间(指定的时间)运行

  1. 问题

    • 芹菜工作没有在规定的时间运行
  2. 情况

    我曾在CentOS上工作

    第一,

    • 我开始与docker工作芹菜工作。 docker-compose up -d --build

    • 我把$ TZ环境variables设置在Dockerfile中。 FROM python:3.4 ENV TZ=Asia/Seoul RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone ADD requirements.txt . RUN pip install -U pip \ && pip install -r requirements.txt

    • 我们也直接在python文件中设置时间。 (Celery.config.timezoneconfiguration)
      inst = Celery(app.import_name, broker=app.config['CELERY_BROKER_URL']) inst.conf.timezone = 'Asia/Seoul'

    • 但是,任务在预定的时间不工作,而是在不同的时间工作。 'schedule': crontab(minute=0, hour=4) # Intended working time 'schedule': crontab(minute=0, hour=13) # real working time

写在服务器日志上的时间是您设置的时区。 我不明白芹菜工时区设置。

请帮帮我。

感谢您的帮助。