在芹菜拍打的烧瓶中需要帮助

时间:2020-01-17 11:36:47

标签: flask celery celerybeat

您需要有关如何使用make工人运行芹菜拍打的芹菜芹菜的帮助,但无法查看芹菜拍打的情况

  BROKER_URL = "amqp://guest:guest@localhost/"
    CELERY_RESULT_BACKEND = "amqp://guest:guest@localhost/"
    CELERY_TASK_SERIALIZER = "json"
    CELERYBEAT_SCHEDULE = {
     'scheduled_broadcast': {
        'task':'tasks.send',
        'schedule': crontab(minute=1),
        'args':()
    },
    'add-every-30-seconds': {
        'task': 'tasks.post',
        'schedule': 30.0,
        'args': (16, 16)
      },
   }

然后在任务文件中

 @celery.task
   def send():
    print("Hello , ")
    logger.info('Hello')

   @celery.post(name='tasks.add')
   def hello():
    app.logger.info('run my function')

0 个答案:

没有答案