5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 16:56:22 +00:00

fixup! fix: espaciar el procesamiento de tareas

This commit is contained in:
f 2024-03-25 13:33:52 -03:00
parent d7de351e1a
commit 718b864356
No known key found for this signature in database

View file

@ -7,12 +7,12 @@ class ApplicationJob < ActiveJob::Base
# Esperar una cantidad random de segundos primos, para que no se
# superpongan tareas
#
# @return [Array<ActiveSupport::Duration>]
RANDOM_WAIT = [3, 5, 7, 11, 13].seconds
# @return [Array<Integer>]
RANDOM_WAIT = [3, 5, 7, 11, 13]
# @return [ActiveSupport::Duration]
def self.random_wait
RANDOM_WAIT.sample
RANDOM_WAIT.sample.seconds
end
private