Handle very long pihole session lengths

This commit is contained in:
shamoon 2025-03-04 18:39:53 -08:00
parent d26ec27942
commit f7def5c2ce
No known key found for this signature in database

View File

@ -28,7 +28,11 @@ async function login(widget, service) {
logger.error("Failed to login to Pi-Hole API, status: %d", status); logger.error("Failed to login to Pi-Hole API, status: %d", status);
cache.del(`${sessionSIDCacheKey}.${service}`); cache.del(`${sessionSIDCacheKey}.${service}`);
} else { } else {
cache.put(`${sessionSIDCacheKey}.${service}`, dataParsed.session.sid, dataParsed.session.validity * 1000); cache.put(
`${sessionSIDCacheKey}.${service}`,
dataParsed.session.sid,
Math.min(2147483647, dataParsed.session.validity * 1000), // https://github.com/ptarjan/node-cache/issues/84
);
} }
} }