khatru: allow disabling expiration manager.

This commit is contained in:
fiatjaf
2025-07-28 22:06:12 -03:00
parent a4d8491d2d
commit 88096fbd84
2 changed files with 22 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import (
"log"
"net/http"
"os"
"slices"
"strconv"
"strings"
"sync"
@@ -168,3 +169,12 @@ func (rl *Relay) getBaseURL(r *http.Request) string {
}
return proto + "://" + host
}
func (rl *Relay) DisableExpiration() {
rl.expirationManager.stop()
idx := slices.Index(rl.Info.SupportedNIPs, 40)
if idx != -1 {
rl.Info.SupportedNIPs[idx] = rl.Info.SupportedNIPs[len(rl.Info.SupportedNIPs)-1]
rl.Info.SupportedNIPs = rl.Info.SupportedNIPs[0 : len(rl.Info.SupportedNIPs)-1]
}
}