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

Problem on determining the actual job_class of a sidekiq job #45

Open
malvarezphrase opened this issue Feb 15, 2024 · 1 comment
Open

Comments

@malvarezphrase
Copy link

Given a sidekiq job where parts of the first argument are user input, the determination of the actual job class fails if the argument contains job_class as a substring.
For example:

["{\"user_id\":1,\"user_input\":[{\"name\":\"John Doe\",\"message\":\"This is a test message with job_class\"}]}

So if the first job argument contains the substring job_class it will return it as a string.

"something_job_class_something"["job_class"]
=> "job_class"

See https://github.com/kenaniah/sidekiq-status/blob/main/lib/sidekiq-status/client_middleware.rb#L25

I suppose using the worker_class first could solve the problem.

This is the error I was getting:

NameError
wrong constant name job_class (NameError)

                  elsif Module.const_defined?(klass)
@malvarezphrase
Copy link
Author

@kenaniah Hi, is this something you could take a look into?

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

No branches or pull requests

1 participant