Sha256: 1174ab0db5bd21bb005877a7e2adb14fe4c8439b4553be295f95a584a6b4f042

Contents?: true

Size: 433 Bytes

Versions: 36

Compression:

Stored size: 433 Bytes

Contents

module Sqewer
  class Resubmit
    attr_reader :job
    attr_reader :execute_after
    
    def initialize(job_to_resubmit, execute_after_timestamp)
      @job = job_to_resubmit
      @execute_after = execute_after_timestamp
    end
    
    def run(ctx)
      # Take the maximum delay period SQS allows
      required_delay = (@execute_after - Time.now.to_i)
      ctx.submit!(@job, delay_seconds: required_delay)
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
sqewer-10.0.0 lib/sqewer/resubmit.rb
sqewer-9.0.0 lib/sqewer/resubmit.rb
sqewer-8.1.0 lib/sqewer/resubmit.rb
sqewer-8.1.0.pre.1 lib/sqewer/resubmit.rb
sqewer-8.0.3 lib/sqewer/resubmit.rb
sqewer-8.0.2 lib/sqewer/resubmit.rb
sqewer-8.0.1 lib/sqewer/resubmit.rb
sqewer-8.0.0 lib/sqewer/resubmit.rb
sqewer-7.0.0 lib/sqewer/resubmit.rb
sqewer-6.5.1 lib/sqewer/resubmit.rb
sqewer-6.5.0 lib/sqewer/resubmit.rb
sqewer-6.4.1 lib/sqewer/resubmit.rb
sqewer-6.4.0 lib/sqewer/resubmit.rb
sqewer-6.3.0 lib/sqewer/resubmit.rb
sqewer-6.2.2 lib/sqewer/resubmit.rb
sqewer-6.2.1 lib/sqewer/resubmit.rb
sqewer-6.2.0 lib/sqewer/resubmit.rb
sqewer-6.1.0 lib/sqewer/resubmit.rb
sqewer-6.0.6 lib/sqewer/resubmit.rb
sqewer-6.0.5 lib/sqewer/resubmit.rb