fix: avoid agent runLoop exiting due to ws ping (#8852)

This commit is contained in:
Dean Sheather
2023-08-02 07:25:07 +00:00
committed by GitHub
parent f48e8dcf88
commit b955c5fefc
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -236,7 +236,9 @@ func (a *agent) runLoop(ctx context.Context) {
if err == nil {
continue
}
if errors.Is(err, context.Canceled) {
if ctx.Err() != nil {
// Context canceled errors may come from websocket pings, so we
// don't want to use `errors.Is(err, context.Canceled)` here.
return
}
if a.isClosed() {