Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove connection close check after sub handler #5

Merged
merged 1 commit into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
}
}
Loading