feat: catch Interrupt and SIGTERM signals to ensure plugin quitted

This commit is contained in:
debugtalk
2022-01-18 17:33:26 +08:00
parent 9a1d02c7b2
commit 142bc13c94
2 changed files with 16 additions and 0 deletions

View File

@@ -137,6 +137,7 @@ func (p *HashicorpPlugin) Call(funcName string, args ...interface{}) (interface{
func (p *HashicorpPlugin) Quit() error {
// kill hashicorp plugin process
log.Warn().Msg("quit hashicorp plugin process")
pluginHost.Quit()
return nil
}