Added cache reload button to admin panel so restarts are needed less often.

This commit is contained in:
2026-03-06 06:12:23 +01:00
parent 9a59448933
commit 6c1f1c2a1c
12 changed files with 78 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ export default async function initRestrictionHandler() {
const reader = await Reader.open('assets/GeoLite2-City.mmdb');
function getRestriction(req) {
if (req.session.restriction && req.session.country && req.session.restrictionIp === req.userIp) {
if (Object.hasOwn(req.session, 'restriction') && Object.hasOwn(req.session, 'country') && req.session.restrictionIp === req.userIp) {
return {
restriction: req.session.restriction,
country: req.session.country,
@@ -71,6 +71,10 @@ export default async function initRestrictionHandler() {
req.country = country;
} catch (error) {
logger.error(`Failed Maxmind IP lookup for ${req.ip}: ${error.message}`);
req.session.restrictionIp = req.userIp;
req.session.restriction = 0;
req.session.country = null;
}
next();