debug: geo db path

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-12-10 20:48:04 +01:00
parent 86a3da869b
commit 9ccca322e5

View File

@@ -21,15 +21,15 @@ let readerPromise: Promise<ReaderModel | null> | null = null;
async function loadDatabase(): Promise<ReaderModel | null> {
try {
const dbBuffer = await readFile(dbPath);
console.log('GeoLite2-City.mmdb loaded (dist)');
console.log('GeoLite2-City.mmdb loaded (dist)', dbPath);
return Reader.openBuffer(dbBuffer);
} catch {
try {
const dbBuffer = await readFile(dbPathLocal);
console.log('GeoLite2-City.mmdb loaded (local)');
console.log('GeoLite2-City.mmdb loaded (local)', dbPathLocal);
return Reader.openBuffer(dbBuffer);
} catch {
console.error('GeoLite2-City.mmdb not found');
console.error('GeoLite2-City.mmdb not found', { dbPath, dbPathLocal });
return null;
}
}