From 54001282d96b640168632381af52988f9f949232 Mon Sep 17 00:00:00 2001 From: bndw Date: Wed, 3 May 2023 09:40:25 -0700 Subject: [PATCH] fix: async save event Uses a non-request-scoped context for async event handling operations. Fixes #50 --- handlers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/handlers.go b/handlers.go index 10372d9..fff3362 100644 --- a/handlers.go +++ b/handlers.go @@ -1,6 +1,7 @@ package relayer import ( + "context" "crypto/rand" "crypto/sha256" "encoding/hex" @@ -107,6 +108,7 @@ func (s *Server) HandleWebsocket(w http.ResponseWriter, r *http.Request) { } go func(message []byte) { + ctx = context.Background() var notice string defer func() { if notice != "" {