Sha256: 3417d57fb07f0a84e429d62420fab411ce463d1d1a2792164266aa5f1f4d14cd
Contents?: true
Size: 980 Bytes
Versions: 50
Compression:
Stored size: 980 Bytes
Contents
# frozen_string_literal: true # To create outside of Rails, insert a row with values for the following columns # into the `delayed_jobs` table: # # handler: {see h7_message_example.yml} # run_at: {current_time e.g. NOW() AT TIME ZONE 'UTC'} # # Notes: # # - the key `raw_message` for the `handler` column must have line endings "\n" # - to run delayed_jobs see in development use rake jobs:work # FeedJob = Struct.new(:raw_message) do def perform Renalware::Feeds.message_processor.call(raw_message) end def max_attempts 2 end def destroy_failed_jobs? false end # Reschedule after an error. No point trying straight away, so try at these intervals: # After attempt no. Wait for hours # --------------------------- # 1 2 # 2 17 # Then give up. # Note e.g. attempts**4 == attempts to the power of 4 def reschedule_at(current_time, attempts) current_time + ((attempts**4) + 1).hours end end
Version data entries
50 entries across 50 versions & 1 rubygems