Skip to content

Commit 5b67e2e

Browse files
stop notifications at the server's request
1 parent e9f6468 commit 5b67e2e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

daemon/ui/notifications.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,20 @@ func (c *Client) listenForNotifications() {
389389
case <-c.clientCtx.Done():
390390
goto Exit
391391
default:
392-
noti, err := c.streamNotifications.Recv()
392+
ntf, err := c.streamNotifications.Recv()
393393
if err == io.EOF {
394394
log.Warning("notification channel closed by the server")
395395
goto Exit
396396
}
397397
if err != nil {
398-
log.Error("getting notifications: %s %s", err, noti)
398+
log.Error("getting notifications: %s %s", err, ntf)
399399
goto Exit
400400
}
401-
c.handleNotification(c.streamNotifications, noti)
401+
if ntf.Type <= protocol.Action_NONE {
402+
log.Debug("Server ordered to close notifications")
403+
goto Exit
404+
}
405+
c.handleNotification(c.streamNotifications, ntf)
402406
}
403407
}
404408
Exit:

0 commit comments

Comments
 (0)