Unique fix for benchmarking

pull/544/head
Mikhael Rakauskas 4 months ago
parent beb991b2a6
commit 47a6ed6980

@ -44,6 +44,7 @@ gem 'turbo-rails'
gem 'twitter_cldr', require: false gem 'twitter_cldr', require: false
gem 'tzinfo-data' gem 'tzinfo-data'
gem 'activejob-uniqueness'
gem 'airbrake' gem 'airbrake'
gem 'newrelic_rpm' gem 'newrelic_rpm'

@ -47,6 +47,9 @@ GEM
activejob (8.0.1) activejob (8.0.1)
activesupport (= 8.0.1) activesupport (= 8.0.1)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activejob-uniqueness (0.4.0)
activejob (>= 4.2, < 8.1)
redlock (>= 2.0, < 3)
activemodel (8.0.1) activemodel (8.0.1)
activesupport (= 8.0.1) activesupport (= 8.0.1)
activerecord (8.0.1) activerecord (8.0.1)
@ -111,6 +114,7 @@ GEM
base64 (0.2.0) base64 (0.2.0)
bcrypt (3.1.20) bcrypt (3.1.20)
benchmark (0.4.0) benchmark (0.4.0)
benchmark-ips (2.12.0)
better_html (2.1.1) better_html (2.1.1)
actionview (>= 6.0) actionview (>= 6.0)
activesupport (>= 6.0) activesupport (>= 6.0)
@ -443,6 +447,8 @@ GEM
psych (>= 4.0.0) psych (>= 4.0.0)
redis-client (0.23.0) redis-client (0.23.0)
connection_pool connection_pool
redlock (2.0.6)
redis-client (>= 0.14.1, < 1.0.0)
regexp_parser (2.9.3) regexp_parser (2.9.3)
reline (0.6.0) reline (0.6.0)
io-console (~> 0.5) io-console (~> 0.5)
@ -594,12 +600,14 @@ PLATFORMS
x86_64-linux-musl x86_64-linux-musl
DEPENDENCIES DEPENDENCIES
activejob-uniqueness
airbrake airbrake
annotaterb annotaterb
arabic-letter-connector arabic-letter-connector
aws-sdk-s3 aws-sdk-s3
aws-sdk-secretsmanager aws-sdk-secretsmanager
azure-storage-blob azure-storage-blob
benchmark-ips (~> 2.12.0)
better_html better_html
bootsnap bootsnap
brakeman brakeman

@ -1,10 +1,12 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'benchmark'
class ApplicationJob < ActiveJob::Base class ApplicationJob < ActiveJob::Base
include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
unique :while_executing, on_conflict: :log
retry_on StandardError, wait: 6.seconds, attempts: 5 unless Docuseal.multitenant? retry_on StandardError, wait: 6.seconds, attempts: 5 unless Docuseal.multitenant?
unique :while_executing, on_conflict: :log
def perform(*args) def perform(*args)
receiver_str, _, message = args.shift.rpartition('.') receiver_str, _, message = args.shift.rpartition('.')

Loading…
Cancel
Save