From b15ad712822c04de8594fb2438900bd7f97493ab Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 1 Dec 2025 18:28:02 -0300 Subject: [PATCH] khatru: negentropy sessions take longer to close. --- khatru/handlers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/khatru/handlers.go b/khatru/handlers.go index 72d8266..d0fc24b 100644 --- a/khatru/handlers.go +++ b/khatru/handlers.go @@ -374,7 +374,7 @@ func (rl *Relay) HandleWebsocket(w http.ResponseWriter, r *http.Request) { // if the message is not empty that means we'll probably have more reconciliation sessions, so store this if out != "" { - deb := debounce.New(time.Second * 7) + deb := debounce.New(time.Minute * 2) negSession := &NegentropySession{ neg: neg, postponeClose: func() { @@ -405,9 +405,10 @@ func (rl *Relay) HandleWebsocket(w http.ResponseWriter, r *http.Request) { // if there is more reconciliation to do, postpone this if out != "" { - negSession.postponeClose() + negSession.postponeClose() // we will close this session after 2 minutes of no activity } else { // otherwise we can just close it + ws.WriteJSON(nip77.CloseEnvelope{SubscriptionID: env.SubscriptionID}) ws.negentropySessions.Delete(env.SubscriptionID) } case *nip77.CloseEnvelope: