Przeglądaj źródła

ensure tail routine dies as well

Thibault bui Koechlin 5 lat temu
rodzic
commit
99b30f1e62
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      pkg/acquisition/file_reader.go

+ 3 - 0
pkg/acquisition/file_reader.go

@@ -238,6 +238,9 @@ LOOP:
 		select {
 		case <-AcquisTomb.Dying(): //we are being killed by main
 			clog.Infof("Killing acquistion routine")
+			if err := ctx.tail.Stop(); err != nil {
+				clog.Warningf("error in stop : %s", err)
+			}
 			break LOOP
 		case <-ctx.tail.Tomb.Dying(): //our tailer is dying
 			clog.Warningf("Reader is dying/dead")