Skip to content

Conversation

@mayocream
Copy link
Contributor

What this PR does / why we need it:

I was reading APISIX code, and found some code could be simplified or reformat.

  • simplify type check
  • reformat indent
  • remove unnecessary local var

This PR didn't solve any problems though.

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
    None.
  • Have you added corresponding test cases?
    No addition features.
  • Have you modified the corresponding document?
    No docs related.
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first



function _M.try_read_attr(tab, ...)
local count = select('#', ...)
Copy link
Member

Choose a reason for hiding this comment

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

Changes below are quite trivial. We don't accept such change which breaks the git blame.
Please remove them.

local lsof_cmd = "lsof -p " .. pid
local hd = popen(lsof_cmd)
local res = hd:read("*a")
local res, err = util.execute_cmd(lsof_cmd)
Copy link
Member

@spacewander spacewander Jun 10, 2021

Choose a reason for hiding this comment

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

We only can accept this change which refactors code and uses the common way.

@mayocream
Copy link
Contributor Author

#4406 (comment)
It's alright only merge this part.

@mayocream mayocream changed the title chore: clean and format code chore: using util lib to exectue cmd Jun 11, 2021
@spacewander
Copy link
Member

Need to fix the lint

@mayocream
Copy link
Contributor Author

Fixed.

@tokers tokers merged commit 401a5ef into apache:master Jun 15, 2021
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.

3 participants