Fix kubernetes providers shutdown and clean safe.Pool
This commit is contained in:
parent
c80d53e7e5
commit
1b63c95c4e
11 changed files with 73 additions and 190 deletions
|
@ -3,6 +3,7 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
|
@ -13,10 +14,10 @@ func (s *Server) configureSignals() {
|
|||
signal.Notify(s.signals, syscall.SIGUSR1)
|
||||
}
|
||||
|
||||
func (s *Server) listenSignals(stop chan bool) {
|
||||
func (s *Server) listenSignals(ctx context.Context) {
|
||||
for {
|
||||
select {
|
||||
case <-stop:
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case sig := <-s.signals:
|
||||
if sig == syscall.SIGUSR1 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue