摘要: 一、目录结构 二、创建worker文件夹 __init__.py # -*- coding:utf-8 -*-import osfrom celery import Celery, platforms# elery不能root用户启动解决(C_FORCE_ROOT environment)platf 阅读全文
posted @ 2020-10-13 19:20 小学弟- 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Celery - 定时任务 定时任务 Celery 中启动定时任务有两种方式,(1)在配置文件中指定;(2)在程序中指定。 # cele.py import celery app = celery.Celery('cele', broker='redis://localhost:6379') @ap 阅读全文
posted @ 2020-10-13 16:48 小学弟- 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 目录结构 第一步 celery_task 里面的celery文件 import time from celery import Celery # celery from celery.schedules import crontab # 将此文件celery启动 windows celery wor 阅读全文
posted @ 2020-10-13 16:18 小学弟- 阅读(355) 评论(2) 推荐(0) 编辑
摘要: 在windows上 使用celery 报错 在windows上 使用celery 报错 ValueError: not enough values to unpack (expected 3, got 0) 原因是官方不支持在windows上使用,但是仍然可以用来测试 安装gevent即可 pip 阅读全文
posted @ 2020-10-13 13:28 小学弟- 阅读(188) 评论(0) 推荐(0) 编辑