python - Heroku Flask 应用程序中的 Celery/CloudAMQP 错误

标签 python heroku flask celery cloudamqp

我在 Heroku(免费层)上运行 Flask 应用程序,在使用 apply_async 安排任务时遇到了一些问题。如果我安排了两个以上的任务,我会得到一个很长的堆栈跟踪,但有一个异常(exception):

AccessRefused(403, u"ACCESS_REFUSED - access to exchange 'celeryresults' in vhost 'rthtwchf' refused for user 'rthtwchf'", (40, 10), 'Exchange.declare')

奇怪的是前两个任务(在重新启动我的所有进程之前)似乎总是毫无问题地完成。

搜索引擎的一点点调查让我找到了 https://stackoverflow.com/questions/21071906/celery-cannot-connect-remote-worker-with-new-username这让它看起来像是一个权限问题,但我认为 Heroku CloudAMPQ 服务已经解决了这个问题。

感谢任何建议!

最佳答案

我认为您的连接超过 3 个(免费计划限制)。将 BROKER_POOL_LIMIT 设置为 1,它将起作用。

关于python - Heroku Flask 应用程序中的 Celery/CloudAMQP 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21634523/

相关文章:

python - 在python字典列表中查找最低值

python - 调试 Apache/Django/WSGI 错误请求 (400) 错误

heroku - Proximo heroku 插件在 https 请求上超时

postgresql - WTForms StringField 写入 Postgres 的编程错误

python - 尝试访问 request.POST 字段时出现 "TypeError: must be str, not bytes"

python - 使用索引中的模式将索引 DataFrame 转换为多索引

ruby-on-rails - ActiveRecord::NoDatabaseError fatal error :数据库 "db/development.postgresql"不存在

ruby-on-rails - 在 force_ssl 之前重定向到 'www'

python - 如何在 Flask-login 中调用 is_authenticated

python - 手动更改 Flask Babel 语言