Open chaegumi opened 2 months ago
@chaegumi gf run
相比较go run
有一些不一样的地方:它会监听源码变化实现自动的编译运行。gf run
会有一个主进程来管理这部分逻辑,并且主进程并不会把接收到的信号转发给子进程,而是强行Kill
掉,源码在这里 https://github.com/gogf/gf/blob/183395f0a0f59c1680ce0e78638dd541e4e1c84e/cmd/gf/internal/cmd/cmd_run.go#L204 。我简单想了一下,这里改进可能比较简单,如果接收到的信号,将信号转发给子进程,并且执行Wait
方法而不是直接Kill
掉。如果没有接收到信号,走原有逻辑。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
@chaegumi
gf run
has some differences compared togo run
: It will monitor source code changes to implement automatic compilation and running.gf run
will have a main process to manage this part of the logic, and the main process will not forward the received signal to the child process, but forciblyKill
it. The source code is here https://github.com/ gogf/gf/blob/183395f0a0f59c1680ce0e78638dd541e4e1c84e/cmd/gf/internal/cmd/cmd_run.go#L204. I briefly thought about it, and the improvement here may be relatively simple. If a signal is received, forward the signal to the child process, and execute theWait
method instead ofKill
directly. If no signal is received, the original logic is followed.
Hello @chaegumi. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it! 你好 @chaegumi。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。
Description
go run能正确运行 gf run不能正确运行
Additional
No response