发现 Celery 4.2.3 不支持类方法
例子:
class Demo:
@app.task
@classmethod
def test(cls):
pass
schedule 注册任务:
Demo.test
发现 Celery 4.2.3 不支持类方法
例子:
class Demo:
@app.task
@classmethod
def test(cls):
pass
schedule 注册任务:
Demo.test
|
chenzi0103Sep 17, 2025
1
直接用 ray 不行吗 celery 写起来太费劲了
|
|
rev1si0nOct 16, 2025
2
什么叫做不支持?
1. 你可以继承 Task 类写 2. 你可以用 base class + bind 指定 为什么要支持? 1. 鬼知道你类在哪初始化了? 2. 谁知道你用了什么 pool ? 3. 多看看文档 |