Refactor exit-after

This commit is contained in:
Leonid Bugaev
2016-07-08 19:27:20 +03:00
parent 6620d25626
commit dae6a8915d
2 changed files with 19 additions and 26 deletions
+1 -7
View File
@@ -32,13 +32,7 @@ func Start(stop chan int) {
for {
select {
case <-stop:
pluginMu.Lock()
for _, p := range Plugins.All {
if cp, ok := p.(io.Closer); ok {
cp.Close()
}
}
pluginMu.Unlock()
finalize()
return
case <-time.After(100 * time.Millisecond):
}