多个 Delayed_Job Worker 写入同一个表 (Rails 3)

发布于 2025-01-01 14:00:29 字数 201 浏览 2 评论 0原文

有没有办法让多个delayed_job工作人员更新到同一个表?我有一个使用 Ruby 1.9.2 的 Rails 3.09 应用程序。我需要运行多个查询,但我不想按顺序运行它们,因为查询结果不相互依赖。但是,结果确实会写入同一个表,但不会写入同一行。 Thinking_Sphinx 也参与其中,因为它更新表。是否可以将delayed_job配置为不锁定全表并允许对同一个表进行多次更新?

Is there a way to have multiple delayed_job workers updating to the same table? I have a Rails 3.09 application using Ruby 1.9.2. I need to run several queries and I want to not have to run them so sequentially since the query results do not rely on each other. However, the results do get written to the same table but not the same row. Thinking_Sphinx is also involved because it updates the table. Can delayed_job be configured to not lock the full table and allow multiple updates to the same table?

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

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

发布评论

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

评论(1

绾颜 2025-01-08 14:00:29

这和DelayedJob没有任何关系。这不是导致表锁的原因。如果您使用 MyISAM,那么这是存储引擎的限制,您应该考虑使用 InnoDB。如果您已经使用 Inno,则需要调查导致全表锁定的原因。

This doesn't have anything to do with DelayedJob. It's not what's causing table locks. If you're using MyISAM then this is a limitation of your storage engine and you should look at InnoDB instead. If you're on Inno already, you'll need to investigate what's causing the full table lock.

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