Sha256: bd113b423cbdb7f679fd534d3cb2d634cc21df8a764f76dc3f1849942b9dfc26

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

# frozen_string_literal: true

module Tobox
  module Plugins
    module Progress
      def self.configure(conf)
        conf.config[:visibility_timeout] = 30
      end

      module FetcherMethods
        private

        def initialize(_, configuration)
          super

          @mark_as_fetched_params[:run_at] = Sequel.date_add(
            Sequel::CURRENT_TIMESTAMP,
            seconds: configuration[:visibility_timeout]
          )
        end

        def events_tr
          yield
        end

        def event_ids_tr(&block)
          @db.transaction(savepoint: false, &block)
        end
      end
    end
    register_plugin :progress, Progress
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tobox-0.5.0 lib/tobox/plugins/progress.rb