faster polling of the modem to detect ip changes
Massimo Melina committed
Aug 27, 2025 at 23:27 UTC
470c8ad3602a4a4ae01955520a4e946a8db70d9c
1 file changed
+3
-3
src/nat.ts
+3
-3
@@ -33,12 +33,12 @@ upnpClient.getGateway().then(res => {
33
console.log("upnp found", res.gateway.description)
34
}, e => console.debug('upnp failed:', e.message || String(e)))
35
36
-// poll external ip
37
-repeat(10 * MINUTE, () => upnpClient.getPublicIp().then(v => {
36
+// poll external ip – asking the modem is cheap, so it can be done often
37
+repeat(MINUTE, () => upnpClient.getPublicIp().then(v => {
38
if (v === defaultBaseUrl.externalIp) return
39
getPublicIps.clearRetain()
40
return defaultBaseUrl.externalIp = v
41
-}))
41
+}, () => {}))
42
43
export const getPublicIps = debounceAsync(async () => {
44
const res = await getProjectInfo()