fix: quit plugin

This commit is contained in:
徐聪
2022-07-21 18:10:01 +08:00
parent 79fe603a06
commit bdb2d4566d
3 changed files with 18 additions and 21 deletions

View File

@@ -3,10 +3,8 @@ package hrp
import (
"fmt"
"os"
"os/signal"
"path/filepath"
"strings"
"syscall"
"github.com/httprunner/funplugin"
"github.com/httprunner/funplugin/fungo"
@@ -79,14 +77,6 @@ func initPlugin(path, venv string, logOn bool) (plugin funplugin.IPlugin, err er
// add plugin instance to plugin map
pluginMap[pluginPath] = plugin
// catch Interrupt and SIGTERM signals to ensure plugin quitted
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
<-c
plugin.Quit()
}()
// report event for initializing plugin
event := sdk.EventTracking{
Category: "InitPlugin",