mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-28 18:51:52 +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
|
package relayer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
@ -107,6 +108,7 @@ func (s *Server) HandleWebsocket(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
go func(message []byte) {
|
go func(message []byte) {
|
||||||
|
ctx = context.Background()
|
||||||
var notice string
|
var notice string
|
||||||
defer func() {
|
defer func() {
|
||||||
if notice != "" {
|
if notice != "" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user