Skip to content

Commit f09efe9

Browse files
committed
Fixing #1192. Waiting to close the job channel until all teardown tasks are done
1 parent ee6decb commit f09efe9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/c2/jobs.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func StartWGListenerJob(listenPort uint16, nListenPort uint16, keyExchangeListen
108108
<-job.JobCtrl
109109
jobLog.Infof("Stopping wg listener (%d) ...", job.ID)
110110
ticker.Stop()
111-
done <- true
111+
112112
err = ln.Close() // Kills listener GoRoutines in StartWGListener()
113113
if err != nil {
114114
jobLog.Fatal("Error closing listener", err)
@@ -118,6 +118,7 @@ func StartWGListenerJob(listenPort uint16, nListenPort uint16, keyExchangeListen
118118
jobLog.Fatal("Error closing wg tunnel", err)
119119
}
120120
core.Jobs.Remove(job)
121+
done <- true
121122
}()
122123
core.Jobs.Add(job)
123124

0 commit comments

Comments
 (0)