air icon indicating copy to clipboard operation
air copied to clipboard

feature-request:About the signal when the killCmd method is executed

Open woshizilong opened this issue 4 years ago • 3 comments

🎉Thank you for your air, I like it very much.

I use Gin to write code for the server. When the server will be shut down,I need to do some processing like closing the database connection. But because the killCmd method sent the syscall.SIGKILL signal, there is no time to close the database connection. When my Gin server is started again by air, an error can occur because the database connection is not closed properly and the server cannot be started. Can I configure the semaphore in config so that I can pass syscall.SIGTERM. It is better if air can set a timeout for waiting for the kill command to end.

This is just a suggestion, I hope to improve the air this useful tool.

woshizilong avatar Oct 18 '19 02:10 woshizilong

I think it's better you handle the syscall.SIGKILL signal in your programs. Please refer to this article.

cosmtrek avatar Oct 18 '19 14:10 cosmtrek

I tried to handle syscall.SIGKILL and the air started before I closed the connection.

woshizilong avatar Oct 21 '19 03:10 woshizilong

I'll try it.

cosmtrek avatar Oct 23 '19 16:10 cosmtrek