flearc opened a new issue, #12528:
URL: https://github.com/apache/apisix/issues/12528

   ### Description
   
   Since [PR #9846](https://github.com/apache/apisix/pull/9846), the 
cleanup(env) function has been refactored to do two things:
   1.   Set profile.apisix_home = env.apisix_home if env.apisix_home is not nil.
   2.   Remove the customized_yaml_index env variable.
   
   See: 
[ops.lua#L768-L798](https://github.com/apache/apisix/blob/master/apisix/cli/ops.lua#L768-L798)
   
   This refactor is fine, but I noticed that the start command still performs 
step (1) again, immediately after calling cleanup(env):
   ```lua
   local function start(env, ...)
       cleanup(env)
   
       if env.apisix_home then
           profile.apisix_home = env.apisix_home
       end
       ...
   end
   ```
   
   Since cleanup(env) already sets profile.apisix_home, the extra assignment in 
start looks redundant and I did not find any statement in the PR explaining why 
this duplicate is needed.
   
   Proposal:
   Remove the duplicate assignment in start to simplify the code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to