fix: quit plugin

This commit is contained in:
徐聪
2022-07-21 18:21:31 +08:00
parent 79fe603a06
commit bdb2d4566d
3 changed files with 18 additions and 21 deletions
+9 -6
View File
@@ -61,6 +61,15 @@ func (b *HRPBoomer) Run(testcases ...ITestCase) {
os.Exit(1)
}
// quit all plugins
defer func() {
if len(pluginMap) > 0 {
for _, plugin := range pluginMap {
plugin.Quit()
}
}
}()
for _, testcase := range testCases {
rendezvousList := initRendezvous(testcase, int64(b.GetSpawnCount()))
task := b.convertBoomerTask(testcase, rendezvousList)
@@ -71,12 +80,6 @@ func (b *HRPBoomer) Run(testcases ...ITestCase) {
}
func (b *HRPBoomer) Quit() {
b.pluginsMutex.Lock()
plugins := b.plugins
b.pluginsMutex.Unlock()
for _, plugin := range plugins {
plugin.Quit()
}
b.Boomer.Quit()
}