khatru: negentropy sessions take longer to close.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user