Handle very long pihole session lengths

pull/4884/head
shamoon 2 months ago
parent d26ec27942
commit f7def5c2ce
No known key found for this signature in database

@ -28,7 +28,11 @@ async function login(widget, service) {
logger.error("Failed to login to Pi-Hole API, status: %d", status);
cache.del(`${sessionSIDCacheKey}.${service}`);
} 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
);
}
}

Loading…
Cancel
Save