Currently, we check GitHub app webhook deliveries every 10 minutes and redeliver any that have failed. If a "workflow_job.queued" delivery fails, the customer waits 10 minutes for a redelivery. I have decided to reduce this frequency to every 5 minutes to enhance the customer experience.
15 lines
382 B
Ruby
15 lines
382 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Prog::RedeliverGithubFailures < Prog::Base
|
|
label def wait
|
|
current_frame = strand.stack.first
|
|
last_check_time = Time.parse(current_frame["last_check_at"])
|
|
Github.redeliver_failed_deliveries(last_check_time)
|
|
current_frame["last_check_at"] = Time.now
|
|
strand.modified!(:stack)
|
|
strand.save_changes
|
|
|
|
nap 5 * 60
|
|
end
|
|
end
|