Skip to content

Commit

Permalink
Remove connection close check after sub handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ekerfelt committed May 14, 2024
1 parent 21b4db2 commit 7f0e7b4
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions encorecloud/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,4 @@ func subscriptionHandlerV1(w http.ResponseWriter, req *http.Request, c *Client,
}
}
flusher.Flush()

// Now wait for the request to be closed by Encore Cloud (upto 5 seconds)
select {
case <-req.Context().Done():
// If the request is closed by Encore Cloud, the context will be cancelled, this is a sign that it has processed
// our end message successfully

case <-time.After(KeepAliveInterval):
// If we get here, the request was not closed by Encore Cloud, so we should log an error
// and return
logger.Err(err).Msg("PubSub push connection was not closed by Encore Cloud after ack/nack message sent")
}
}

0 comments on commit 7f0e7b4

Please sign in to comment.