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