mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
Handle very long pihole session lengths
This commit is contained in:
parent
d26ec27942
commit
f7def5c2ce
@ -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
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user