DEV: Introduce deprecation warning for non-json Job arguments (#15842)

This commit introduces our own handling and warning for Sidekiq's new 'non-json-serializable' warning. This decouples us from Sidekiq's own deprecation cycle, and allows us to use our own deprecation system. It also means that the dump/parse happens in test mode, which will help us to catch occurrences before they reach production.
This commit is contained in:
David Taylor
2022-02-07 17:59:55 +00:00
committed by GitHub
parent a8325c9016
commit c8c23ba557
3 changed files with 25 additions and 10 deletions

View File

@@ -108,7 +108,7 @@ describe Jobs do
end
it "executes the job right away" do
Jobs::ProcessPost.any_instance.expects(:perform).with(post_id: 1, sync_exec: true, current_site_id: "default")
Jobs::ProcessPost.any_instance.expects(:perform).with("post_id" => 1, "sync_exec" => true, "current_site_id" => "default")
Jobs.enqueue(:process_post, post_id: 1)
end