Skip to content
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

更换 django Q 为django-rq #2338

Open
LeoQuote opened this issue Oct 18, 2023 · 16 comments
Open

更换 django Q 为django-rq #2338

LeoQuote opened this issue Oct 18, 2023 · 16 comments

Comments

@LeoQuote
Copy link
Collaborator

重现步骤

N/A

预期外的结果

N/A

日志文本

N/A

版本

1.10.0

部署方式

Docker

是否还有其他可以辅助定位问题的信息?比如数据库版本等

django-q 已经两年没更新了, 可以理解为作者弃用了, 相关的知识也比较少, 可以考虑更换为用户更多, 知识更多的 django-rq 或 celery

@nick2wang
Copy link
Collaborator

celery会重一些,但是用法非常丰富,django异步这块使用率也比较高,可以考虑下

@lanheader
Copy link
Collaborator

能不能引入中间件,如rabbitmq或kafka之类的

@hhyo
Copy link
Owner

hhyo commented Oct 24, 2023

能不能引入中间件,如rabbitmq或kafka之类的

这些都可以作为broker,和任务队列不冲突,要调整建议直接上celery

@lanheader
Copy link
Collaborator

celery确实有点重

@woshiyanghai
Copy link
Contributor

@LeoQuote 大佬这个还有后续动作么?会更换django-q 到django-rq么?

@LeoQuote
Copy link
Collaborator Author

欢迎pr

@woshiyanghai
Copy link
Contributor

jango-q不支持优先级?这就很难受,如果archery 去pt-archiver的时候

@LeoQuote
Copy link
Collaborator Author

嗯,也可以像楼里建议的直接一步到位用最流行的celery ,功能都有

@woshiyanghai
Copy link
Contributor

好的

@woshiyanghai
Copy link
Contributor

我看了下,存在一个问题,之前使用django-q,参数直接传递的都是对象,但是celery 并不推荐直接传递对象?这种你有更好的建议么?

@LeoQuote
Copy link
Collaborator Author

看看你的参考是哪里? 不推荐的话是不是还可以凑合用? 如果是不支持的话, 那可能是要大改了, 以前传对象都是为了方便, 现在不让传对象的话, 很多地方要序列化和反序列化, 可能要加几个 helper 函数

@woshiyanghai
Copy link
Contributor

我是尝试配置了以下celery,这里传入对象,会报错
image

@LeoQuote
Copy link
Collaborator Author

具体是什么错呢? 可以提供下报错和你搜集到的信息吗?

@woshiyanghai
Copy link
Contributor

image
推荐是传入id,然后在最后通知的时候,在使用id获取到对应内容?

@LeoQuote
Copy link
Collaborator Author

LeoQuote commented Aug 27, 2024

那很多都要改了, 有些数据还没进数据库呢, 可以用 pydantic 或者 django restfulframework 的 serilizer 序列化再传, 这可能要改很多很多

或者还有 https://docs.djangoproject.com/en/5.0/topics/serialization/ 这里 django 自带的序列化工具, 也可以达到类似的效果

@woshiyanghai
Copy link
Contributor

我使用celery基本实现了archery 上django-q的功能,现在还有点小问题

@LeoQuote LeoQuote mentioned this issue Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants