Sha256: 6bd029956a8f6567cc22359f798f5681fc78f83cc5dd199b591aac2ab5a7863f

Contents?: true

Size: 524 Bytes

Versions: 1

Compression:

Stored size: 524 Bytes

Contents

# frozen_string_literal: true

require "active_job"
require "flipper/notifications/webhooks/errors"

module Flipper
  module Notifications
    class WebhookNotificationJob < ActiveJob::Base

      # TODO: Pull queue from configuration?
      # queue_as :low

      retry_on Webhooks::NetworkError,
               Webhooks::ServerError,
               attempts: 3,
               wait:     :exponentially_longer

      def perform(webhook:, **webhook_args)
        webhook.notify(**webhook_args)
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flipper-notifications-0.1.1 lib/flipper/notifications/jobs/webhook_notification_job.rb