-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
used cjson.safe instead of pcall. #3674
Conversation
@moonming thanks for the PR! As far as I can tell Also it would be great if you add a new test case to https://github.com/kubernetes/ingress-nginx/blob/master/rootfs/etc/nginx/lua/test/configuration_test.lua to cover the case where JSON payload is not correct - to make sure the error handled properly without blowing up.
How's it better performance? Because we eliminate an extra function ( |
@ElvinEfendi added the error message to log, thx.
yes, it can eliminate an extra Lua function call. |
CI is failing because of this. Once you fix the please squash your commits into one. |
fixed and squashed commits into one. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ElvinEfendi, moonming The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
better performance and readable.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer: