-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] 在HOME上启动celery定时任务时提示:celery未运行 #17
Comments
你是用源码部署还是docker呢,请把启动celery后的控制台日志给我看一下呢 |
您好!我用源码部署,日志如下: Sept. 22, 2024, 1:16 p.m. | check_wechat_status | 成功 | null | {"status": "error", "message": "\u672a\u8fde\u63a5\u5230\u670d\u52a1\u5668"} |
你用源码部署,点启动celery后,终端会有celery启动消息显示的,你看看那个 |
[22/Sep/2024 13:16:16] "GET /favicon.ico HTTP/1.1" 404 9787 |
[22/Sep/2024 13:57:17] "POST /start_celery/ HTTP/1.1" 200 28 -------------- celery@DESKTOP-NKMNF7I v5.4.0 (opalescent)
[tasks] [2024-09-22 13:57:19,979: WARNING/MainProcess] C:\Program Files\Python312\Lib\site-packages\celery\worker\consumer\consumer.py:508: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine [2024-09-22 13:57:20,725: INFO/SpawnPoolWorker-4] child process 12592 calling self.run() [2024-09-22 13:57:22,056: INFO/MainProcess] Scheduler: Sending due task ping-server-every-minute (client_app.tasks.ping_server) The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): |
看起来celery成功启动了,但是任务执行的时候出错 你先设置一个定时发送消息任务试试能不能跑?
这个任务每分钟都会执行一次 |
是不是因为我没有设置邮箱,celery启动失败? |
所以设置* * * * *实际上也不能自动发送是吗? 邮箱这个也有可能,你可以设置一下邮箱,内容随便填不要空就行 |
设置* * * * *实际上也不能自动发送。 |
我设置一下邮箱再试试 |
了解了,我感觉是环境的问题,你可以试试win开wsl2,用docker部署,这样免去奇奇怪怪的问题 Windows源码部署我还没试过,我自己实际上使用macOS源码开发,然后在ubuntu服务器上用docker部署,有空我测试一下Windows源码部署 |
不是上面这些问题,是“subprocess.Popen(['celery', '-A', 'YuYuWechatV2_Client', 'worker', '--loglevel=info'])”这个启动的时候异常了,可以看Client控制台输出信息 |
任务管理器只能看到一个celery进程而已,实际上按程序应该是2个才是 |
你也遇到这个问题了吗,也有可能是subprocess.Popen的问题,有可能是win的subprocess.Popen实现方法跟类unix实现方法不一样,有点怪 |
Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): |
我的也是这个问题,把里面的命令直接放cmd里面运行是可以的,不过网上说要补充一个变量 “-P eventlet”
但是补充到程序里面是不识别到“ -P eventlet”这个参数。我也是无力了,建议博主更换个定时器吧!起码按目前看是不太兼容部分同志们的电脑 |
目前我建议使用docker部署,docker镜像经过多次自动化测试,并且我也使用docker部署在生产环境,可以保证可靠性
这样看,似乎问题出在celery,我需要更多时间来调试Windows的环境问题,并且修改多线程的实现有可能引入破坏性修改,反而导致类unix系统运行出问题,考虑到win也可以跑docker,我可能不会积极适配win运行源码 所以这个问题先搁置,如果有更多想法或者错误日志,欢迎继续提出讨论 |
感谢上面的大佬! |
好的,非常感谢
|
服务端启动后请求http://127.0.0.1:8000/wechat/ping/ 然后客户端首页显示 微信不在线。 |
你好,你要讨论的问题跟本issues不相关,请你再开一个新issues |
提出issues前请先确保你看完了README
描述Bug
在(http://127.0.0.1:7500/home/)上启动celery定时任务时提示:celery未运行
重现步骤
启动了前后端,打开了postgres和redis,打开登录页面,配置服务器和微信都没问题。消息提前发送,也可以立即执行。但启动启动celery定时任务时提示:celery未运行
截图
环境 (请完成以下信息):
The text was updated successfully, but these errors were encountered: