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

Sometimes the call for jobs data, returns malformed info. #38

Open
AlexandruCD opened this issue Jul 14, 2015 · 2 comments
Open

Sometimes the call for jobs data, returns malformed info. #38

AlexandruCD opened this issue Jul 14, 2015 · 2 comments

Comments

@AlexandruCD
Copy link

Happens often that when I run some jobs, they are executed successfully by sidekiq but the response from calling 'api/jobs' is broken. That leads to a jQuery error(cannot read property length of undefined). The response, instead of being a valid json, is a string like it:
"#Sidekiq::Monitor::JobsDatatable:0x0000000eab2990"
Restarting the rails server fixes it. At the runtime, neither of deleting rows from mysql or keys from redis don't help.

@AlexandruCD
Copy link
Author

Seems like the problem is here. Sometimes after certain jobs get executed, when this is getting called
render json: JobsDatatable.new(view_context)
It no longer goes through as_json from RailsDatatable gem. It goes through the class initialize method, but for some reason, it does'nt go after into as_json.

@AlexandruCD
Copy link
Author

After a lot of research, i found that in one of my models i have something like that
require 'json/pure'
Everytime i make a query for its associated table, or make use of the model, this seems like is overwriting the sidekiq-monitor as_json definition it inherits from railsdatatable.
Any solution for this?

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