用add_periodic_task()设置芹菜击败任务优先级

发布于 2025-02-13 07:34:33 字数 273 浏览 0 评论 0原文

我已经进行了广泛的搜索,但找不到任何东西。

当使用add_periodic_task()之类的东西时,是否可以为芹菜节拍任务设置芹菜任务优先级

sender.add_periodic_task(
    crontab(minute="*/5"),
    self_monitor_health_checks,
    priority=3,
)

I've searched extensively, but cannot find anything on this.

Is it possible to set a celery task priority for a celery beat task, when using add_periodic_task() something like:

sender.add_periodic_task(
    crontab(minute="*/5"),
    self_monitor_health_checks,
    priority=3,
)

Thanks for your help and input.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人生戏 2025-02-20 07:34:33

事实证明,尽管没有证件,但上述确实有效。您可以设置这样的优先级:

sender.add_periodic_task(
    crontab(minute="*/5"),
    self_monitor_health_checks,
    priority=3,
)

It turns out that the above does work, despite it being undocumented. You can set a priority like this:

sender.add_periodic_task(
    crontab(minute="*/5"),
    self_monitor_health_checks,
    priority=3,
)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文