Sha256: d3d7ceab53f4e4218c4499c32e105b8f947f3a8510eaa1bab68201530b864fc7

Contents?: true

Size: 850 Bytes

Versions: 23

Compression:

Stored size: 850 Bytes

Contents

require 'delayed/job'

require 'thinking_sphinx/deltas/delayed_delta/delta_job'
require 'thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job'
require 'thinking_sphinx/deltas/delayed_delta/job'

module ThinkingSphinx
  module Deltas
    class DelayedDelta < ThinkingSphinx::Deltas::DefaultDelta
      def index(model, instance = nil)
        ThinkingSphinx::Deltas::Job.enqueue(
          ThinkingSphinx::Deltas::DeltaJob.new(delta_index_name(model)),
          ThinkingSphinx::Configuration.instance.delayed_job_priority
        )
        
        Delayed::Job.enqueue(
          ThinkingSphinx::Deltas::FlagAsDeletedJob.new(
            core_index_name(model), instance.sphinx_document_id
          ),
          ThinkingSphinx::Configuration.instance.delayed_job_priority
        ) if instance
        
        true
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 6 rubygems

Version Path
DrMark-thinking-sphinx-1.1.14 lib/thinking_sphinx/deltas/delayed_delta.rb
DrMark-thinking-sphinx-1.1.15 lib/thinking_sphinx/deltas/delayed_delta.rb
dpickett-thinking-sphinx-1.1.12 lib/thinking_sphinx/deltas/delayed_delta.rb
dpickett-thinking-sphinx-1.1.23 lib/thinking_sphinx/deltas/delayed_delta.rb
ebeigarts-thinking-sphinx-1.1.21 lib/thinking_sphinx/deltas/delayed_delta.rb
ebeigarts-thinking-sphinx-1.1.22 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.11 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.12 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.14 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.15 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.16 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.17 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.18 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.19 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.20 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.21 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.22 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.23 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.1.24 lib/thinking_sphinx/deltas/delayed_delta.rb
freelancing-god-thinking-sphinx-1.2.0 lib/thinking_sphinx/deltas/delayed_delta.rb