Class: ThinkingSphinx::Deltas::DeleteJob
- Inherits:
-
Object
- Object
- ThinkingSphinx::Deltas::DeleteJob
- Defined in:
- lib/thinking_sphinx/deltas/delete_job.rb
Instance Method Summary collapse
-
#initialize(index_name, document_id) ⇒ DeleteJob
constructor
A new instance of DeleteJob.
- #perform ⇒ Object
Constructor Details
#initialize(index_name, document_id) ⇒ DeleteJob
Returns a new instance of DeleteJob.
2 3 4 |
# File 'lib/thinking_sphinx/deltas/delete_job.rb', line 2 def initialize(index_name, document_id) @index_name, @document_id = index_name, document_id end |
Instance Method Details
#perform ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/thinking_sphinx/deltas/delete_job.rb', line 6 def perform ThinkingSphinx::Connection.pool.take do |connection| connection.execute Riddle::Query.update( @index_name, @document_id, :sphinx_deleted => true ) end rescue Mysql2::Error => error # This isn't vital, so don't raise the error. end |