Fixes rubocop offencses

This commit is contained in:
Brusk Awat 2023-04-05 23:56:59 +03:00
parent e6f41a0cf9
commit 18aaa8bc26
Signed by: broosk1993
GPG Key ID: 5D20F7E02649F74E
4 changed files with 5 additions and 6 deletions

View File

@ -12,8 +12,7 @@ gem 'rspec', '~> 3.0'
gem 'rubocop-rails', '~> 2.18' gem 'rubocop-rails', '~> 2.18'
group :development, :test do group :development, :test do
gem "sidekiq", "~> 7.0", require: true gem 'activesupport', '~> 7.0'
gem "sidekiq-cron", "~> 1.10" gem 'sidekiq', '~> 7.0', require: true
gem "activesupport", "~> 7.0" gem 'sidekiq-cron', '~> 1.10'
end end

View File

@ -6,7 +6,7 @@ module Outboxable
def perform def perform
Outbox.pending.where(last_attempted_at: [..Time.zone.now, nil]).find_in_batches(batch_size: 100).each do |batch| Outbox.pending.where(last_attempted_at: [..Time.zone.now, nil]).find_in_batches(batch_size: 100).each do |batch|
batch.each do |outbox| batch.each do |outbox|
# This is to prevent a job from being retried too many times. Worst-case scenario is 1 minute delay in jobs. # This is to prevent a job from being retried too many times. Worst-case scenario is 1 minute delay in jobs.
outbox.update(last_attempted_at: 1.minute.from_now) outbox.update(last_attempted_at: 1.minute.from_now)
Outboxable::Worker.perform_async(outbox.id) Outboxable::Worker.perform_async(outbox.id)
end end

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
module Outboxable module Outboxable
VERSION = "0.1.3" VERSION = '0.1.3'
end end

BIN
outboxable-0.1.3.gem Normal file

Binary file not shown.