gpt4 book ai didi

thinking-sphinx - Delta 索引 - 延迟作业不起作用

转载 作者:行者123 更新时间:2023-12-04 21:20:51 26 4
gpt4 key购买 nike

该代码在延迟作业及其在 delay_jobs 表中的制作队列中工作正常,工作人员正在处理它们,但我们仍然在销毁对象时遇到异常

这是痕迹

vendor/bundle/ruby/1.9.1/gems/riddle-1.5.1/lib/riddle/client.rb:639:in `recv'
vendor/bundle/ruby/1.9.1/gems/riddle-1.5.1/lib/riddle/client.rb:639:in `block in request'
vendor/bundle/ruby/1.9.1/gems/riddle-1.5.1/lib/riddle/client.rb:538:in `connect'
vendor/bundle/ruby/1.9.1/gems/riddle-1.5.1/lib/riddle/client.rb:623:in `request'
vendor/bundle/ruby/1.9.1/gems/riddle-1.5.1/lib/riddle/client.rb:226:in `run'
vendor/bundle/ruby/1.9.1/gems/riddle-1.5.1/lib/riddle/client.rb:338:in `query'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/search.rb:414:in `block (2 levels) in populate'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `block in instrument'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `instrument'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/search.rb:518:in `log'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/search.rb:527:in `log'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/search.rb:413:in `block in populate'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/search.rb:568:in `call'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/search.rb:568:in `retry_on_stale_index'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/search.rb:411:in `populate'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/search.rb:176:in `method_missing'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/search_methods.rb:395:in `search_for_id'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/active_record.rb:268:in `delete_in_index'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/active_record.rb:348:in `block in toggle_deleted'
vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/active_record.rb:34
.
.
.
app/controllers/received_messages_controller.rb:142:in `destroy'

添加了延迟作业增量的问题,那么为什么它试图直接击中思维狮身人面像?

这是定义索引块
  define_index do
if Rails.env.production?
set_property :delta => FlyingSphinx::DelayedDelta
else
set_property :delta => true
end

indexes message.subject

has user_id, read, created_at

where "users_user_messages.is_active = 'Y'"

end

最佳答案

这里发生的事情是 Thinking Sphinx 在将对象标记为已删除之前检查 Sphinx 中是否存在该对象 - 唯一的方法是搜索它。不过,Thinking Sphinx 中内置了一些错误处理功能,应该可以捕获(并忽略)来自 Sphinx 的错误,所以我有点不确定为什么会出现异常。

你能分享一下堆栈跟踪之前出现的错误描述吗?

此外,这与延迟作业无关。

关于thinking-sphinx - Delta 索引 - 延迟作业不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11999544/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com