mirror of
https://github.com/fiatjaf/khatru.git
synced 2026-06-01 16:23:04 +02:00
fix: async save event
Uses a non-request-scoped context for async event handling operations. Fixes #50
This commit is contained in:
@@ -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 != "" {
|
||||
|
||||
Reference in New Issue
Block a user