A platform for community discussion. Free, open, simple.
DEV: Fix job serialization warnings (#30735)
Jarek Radoszb28fafd37275
diff --git a/app/jobs/regular/run_problem_check.rb b/app/jobs/regular/run_problem_check.rbindex 161f0b21180..4ddab54b093 100644--- a/app/jobs/regular/run_problem_check.rb+++ b/app/jobs/regular/run_problem_check.rb@@ -22,7 +22,7 @@ module JobsJobs.enqueue_in(check.retry_after,:run_problem_check,- args.merge(retry_count: retry_count + 1).stringify_keys,+ args.merge(retry_count: retry_count + 1),)rescue StandardError => errDiscourse.warn_exception(diff --git a/spec/jobs/run_problem_check_spec.rb b/spec/jobs/run_problem_check_spec.rbindex b58f55d385b..a73feb453d9 100644--- a/spec/jobs/run_problem_check_spec.rb+++ b/spec/jobs/run_problem_check_spec.rb@@ -29,7 +29,7 @@ RSpec.describe Jobs::RunProblemCheck doit "updates the problem check tracker" doexpect {- described_class.new.execute(check_identifier: :test_check, retry_count: 0)+ described_class.new.execute(check_identifier: "test_check", retry_count: 0)}.to change { ProblemCheckTracker.failing.count }.by(1)endend@@ -53,7 +53,7 @@ RSpec.describe Jobs::RunProblemCheck doit "does not yet update the problem check tracker" doexpect {- described_class.new.execute(check_identifier: :test_check, retry_count: 1)+ described_class.new.execute(check_identifier: "test_check", retry_count: 1)}.not_to change { ProblemCheckTracker.where("blips > ?", 0).count }end@@ -61,10 +61,10 @@ RSpec.describe Jobs::RunProblemCheck doexpect_enqueued_with(job: :run_problem_check,args: {- check_identifier: :test_check,+ check_identifier: "test_check",retry_count: 1,},- ) { described_class.new.execute(check_identifier: :test_check) }+ ) { described_class.new.execute(check_identifier: "test_check") }endend@@ -87,13 +87,13 @@ RSpec.describe Jobs::RunProblemCheck doit "updates the problem check tracker" doexpect {- described_class.new.execute(check_identifier: :test_check, retry_count: 1)+ described_class.new.execute(check_identifier: "test_check", retry_count: 1)}.to change { ProblemCheckTracker.where("blips > ?", 0).count }.by(1)endit "does not schedule a retry" doexpect_not_enqueued_with(job: :run_problem_check) do- described_class.new.execute(check_identifier: :test_check, retry_count: 1)+ described_class.new.execute(check_identifier: "test_check", retry_count: 1)endendend