air
air copied to clipboard
feature-request:About the signal when the killCmd method is executed
🎉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.
I think it's better you handle the syscall.SIGKILL signal in your programs. Please refer to this article.
I tried to handle syscall.SIGKILL and the air started before I closed the connection.
I'll try it.