# 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_id_tr(&block) @db.transaction(savepoint: false, &block) end end end register_plugin :progress, Progress end end