Skip to content

[FIX] Run pretty json only when realy relevant, e.g. debug mode on !515 #307

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

Closed
wants to merge 1 commit into from
Closed

Conversation

AvnerCohen
Copy link

I'm still setting up the environment, however it's clear that n production, the actual stack stem from the generate_json call:

/vendor/ruby-2.1.5/lib/ruby/2.1.0/json/common.rb:285 in "pretty_generate"
/app/models/search.rb:53 in "block in execute"
/vendor/bundle/ruby/2.1.0/gems/tire-0.6.2/lib/tire/model/search.rb:97 in "instance_eval"
/vendor/bundle/ruby/2.1.0/gems/tire-0.6.2/lib/tire/model/search.rb:97 in "search"
/app/models/search.rb:31 in "execute"
/app/controllers/protips_controller.rb:375 in "search"
/app/controllers/protips_controller.rb:23 in "index"

Changing the log line to block makes a more efficient call (e.g. when not in debug level, line is not being executed) with the extra benefit that if the issue is only in this printing line, it will no longer occur.
that being said, I haven't being able to verify that. yet.

seuros pushed a commit to seuros/coderwall that referenced this pull request Mar 1, 2015
seuros pushed a commit to seuros/coderwall that referenced this pull request Mar 1, 2015
@seuros seuros closed this Mar 12, 2015
@AvnerCohen
Copy link
Author

@seuros would you care to explain why you are closing this?

You see any reason to execute this in prod?

@seuros
Copy link
Contributor

seuros commented Mar 12, 2015

I removed all debug statement from the code-base.

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.

2 participants