ruby-on-rails - Resque/Rails/Heroku: PG::Error: 结果已被清除

标签 ruby-on-rails postgresql heroku backgroundworker resque

我正在尝试让 resque 与 heroku 一起工作。它适用于我的其他应用程序,但我不明白工作日志中的这个错误:

PG::Error: result has been cleared: SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1

因此,每当我将作业添加到队列时,工作人员都会接受该作业并抛出上述错误。

这是 worker 类(Class):

class Companies
  @queue = :companies

  def self.perform(current_user_id, model)
    @current_user = User.find(current_user_id)

    ... do things with @current_user and model...
  end
end

我调用执行操作使用:Resque.enqueue(Companies, current_user.id, 'quotes')

最佳答案

此错误消息表示用于与 Postgres 数据库交互的 PG gem 中存在内部错误。它表示垃圾收集/内存分配错误,其中执行的 postgres 查询的结果已在访问时从内存中清除。

像 heroku 这样的人将不得不对此进行调试,这似乎是一个平台级别的问题。

关于ruby-on-rails - Resque/Rails/Heroku: PG::Error: 结果已被清除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9654952/

相关文章:

ruby-on-rails - 回形针,CKEditor validates_attachment_content_type 错误

macos - Postgres 数据库没有角色

ruby-on-rails - 无法找到 Rails/Heroku : "The page you were looking for doesn' t exist"的解决方案

heroku - 如何阻止 Heroku 应用程序被 Google 索引?

ruby-on-rails - Rails - 本地机器上现有的开发 Postgres 数据库到 Heroku

ruby-on-rails - Heroku、Rails 和 ActiveUUID——Heroku 使用旧的迁移文件?

ruby-on-rails - 是否有可能干掉这个迁移?

sql - Sequelize : Create instance with existing association

ruby-on-rails - Rails, rake 不起作用

java - org.postgresql.util.PSQLException : The column name grupo was not found in this ResultSet.(不同的错误)