Added cache reload button to admin panel so restarts are needed less often.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user