mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-17 21:32:55 +01:00
fix: async save event
Uses a non-request-scoped context for async event handling operations. Fixes #50
This commit is contained in:
parent
ae641fd24d
commit
54001282d9
@ -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 != "" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user