Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DRY-up job class/args extraction #185

Merged
merged 2 commits into from
Apr 7, 2024
Merged

fix: DRY-up job class/args extraction #185

merged 2 commits into from
Apr 7, 2024

Conversation

ixti
Copy link
Owner

@ixti ixti commented Mar 16, 2024

Related-PR: #184

@ixti ixti requested a review from freemanoid March 16, 2024 03:32
@ixti
Copy link
Owner Author

ixti commented Mar 16, 2024

cc: @jlledom

Copy link

codecov bot commented Mar 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.98%. Comparing base (3c1c543) to head (f6a7b0d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #185      +/-   ##
==========================================
+ Coverage   98.95%   98.98%   +0.03%     
==========================================
  Files          18       19       +1     
  Lines         383      396      +13     
  Branches       55       56       +1     
==========================================
+ Hits          379      392      +13     
  Misses          4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@freemanoid freemanoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LCTM

Copy link
Contributor

@jlledom jlledom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine for me. 👍

@mnovelo
Copy link
Contributor

mnovelo commented Mar 20, 2024

Sidekiq::Pro specs pass too!

@jeffbax
Copy link

jeffbax commented Mar 28, 2024

Pardon the crudeness of the example, but I had noticed a similar situation to #184 attempting to adopt this gem over the past week or so (moving from https://github.com/veeqo/activejob-uniqueness) although this is for using the threshold strategy not the concurrency one.

ERROR: Failed to get key suffix: wrong number of arguments (given 1, expected 2+)

basically when I substitute

key_suffix: ->(args) do
  puts args
  raise
end

My output is

 {
   "job_class" => "Events::JobKlass", 
   "job_id" => "abaccc09-9916-4ca4-9765-77968d09bbde", 
   "provider_job_id" => nil, 
   "queue_name" => "data_queue_low", 
   "priority" => nil, 
   "arguments" => ["Events::SavedEvent", { "id" => 307, "status_id_changes" => [1, 2], "_aj_symbol_keys" => [] }], 
   "executions" => 0, 
   "exception_executions" => {}, 
   "locale" => "en", 
   "timezone" => "Eastern Time (US & Canada)", 
   "enqueued_at" => "2024-03-28T18:14:14Z", 
   "first_enqueued_at" => 1711649654,
 }

Whereas I was expecting to get the position arguments from the arguments key:

  • "Events::SavedEvent"
  • { "id" => 307, "status_id_changes" => [1, 2], "_aj_symbol_keys" => [] }

Is this an incorrect assumption on my part or perhaps a similar snag?

@ixti
Copy link
Owner Author

ixti commented Apr 2, 2024

Will finish this PR and cut patch release this week.

@ixti ixti merged commit f6a7b0d into main Apr 7, 2024
19 checks passed
@ixti ixti deleted the fix-ci branch April 7, 2024 19:38
@ixti
Copy link
Owner Author

ixti commented Apr 7, 2024

Released as v1.4.0

@jeffbax
Copy link

jeffbax commented Apr 8, 2024

Released as v1.4.0

thanks! will give it a shot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants