fix: async save event

Uses a non-request-scoped context for async event handling operations.

Fixes #50
This commit is contained in:
bndw 2023-05-03 09:40:25 -07:00 committed by fiatjaf_
parent ae641fd24d
commit 54001282d9

View File

@ -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 != "" {