mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-06 16:29:37 +08:00
fix: quit plugin
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user