Sha256: 4efd3ddc7045f0f0f1cc5b5be778fbf33f76ae30997bcbe4b9edf2c2bd3001f0

Contents?: true

Size: 646 Bytes

Versions: 52

Compression:

Stored size: 646 Bytes

Contents

# frozen_string_literal: true

module Cloudtasker
  module UniqueJob
    module ConflictStrategy
      # This strategy raises an error on conflict, both on client and server side.
      class Raise < BaseStrategy
        RESCHEDULE_DELAY = 5 # seconds

        # Raise a Cloudtasker::UniqueJob::LockError
        def on_schedule
          raise_lock_error
        end

        # Raise a Cloudtasker::UniqueJob::LockError
        def on_execute
          raise_lock_error
        end

        private

        def raise_lock_error
          raise(UniqueJob::LockError, id: job.id, unique_id: job.unique_id)
        end
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
cloudtasker-0.14.rc1 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.13.2 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.13.1 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.13.0 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.13.rc2 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.13.rc1 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.12.2 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.12.1 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.11.1 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.10.2 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.9.5 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.12.0 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.12.rc11 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.12.rc10 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.12.rc9 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.12.rc8 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.12.rc7 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.12.rc6 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.12.rc5 lib/cloudtasker/unique_job/conflict_strategy/raise.rb
cloudtasker-0.12.rc4 lib/cloudtasker/unique_job/conflict_strategy/raise.rb