# frozen_string_literal: true # Base para trabajos class ApplicationJob < ActiveJob::Base include Que::ActiveJob::JobExtensions # Esperar una cantidad random de segundos primos, para que no se # superpongan tareas # # @return [Array] RANDOM_WAIT = [3, 5, 7, 11, 13].seconds # @return [ActiveSupport::Duration] def self.random_wait RANDOM_WAIT.sample end private def site @site ||= Site.find @params[:site_id] end end