Fixed edge case where a message is being processed while a client is disconnecting.

This commit is contained in:
Atridad Lahiji 2024-05-02 14:55:28 -06:00
parent 595802158e
commit cdb51bac86
No known key found for this signature in database

View file

@ -100,7 +100,7 @@ func HandleIncomingMessages(c echo.Context, pubsub pubsub.PubSubMessage, client
msg, err := pubsub.ReceiveMessage(c.Request().Context()) msg, err := pubsub.ReceiveMessage(c.Request().Context())
if err != nil { if err != nil {
log.Printf("Failed to receive message: %v", err) log.Printf("Failed to receive message: %v", err)
continue return
} }
data := fmt.Sprintf("data: %s\n\n", msg.Payload) data := fmt.Sprintf("data: %s\n\n", msg.Payload)