mirror of
https://github.com/go-micro/go-micro.git
synced 2025-08-10 21:52:01 +02:00
Stop LogStream if there is an error in k8s pod log streaming (#1469)
* Stop LogStream if there is an error in k8s pod log streaming * Locking stream Stops * PR comment
This commit is contained in:
@@ -330,6 +330,7 @@ type kubeStream struct {
|
||||
// the k8s log stream
|
||||
stream chan runtime.LogRecord
|
||||
// the stop chan
|
||||
sync.Mutex
|
||||
stop chan bool
|
||||
err error
|
||||
}
|
||||
@@ -343,6 +344,8 @@ func (k *kubeStream) Chan() chan runtime.LogRecord {
|
||||
}
|
||||
|
||||
func (k *kubeStream) Stop() error {
|
||||
k.Lock()
|
||||
defer k.Unlock()
|
||||
select {
|
||||
case <-k.stop:
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user