mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 12:05:41 +01:00
Remove debug console logs from geolocation detection
This commit is contained in:
parent
c6373adcb1
commit
26258b37a3
1 changed files with 0 additions and 3 deletions
|
|
@ -19,7 +19,6 @@ let lookupPromise: any = null;
|
||||||
// This function returns the open DB. If it's already opening/open, just return the existing promise.
|
// This function returns the open DB. If it's already opening/open, just return the existing promise.
|
||||||
export function getLookup() {
|
export function getLookup() {
|
||||||
if (!lookupPromise) {
|
if (!lookupPromise) {
|
||||||
console.log('debug: loading GeoLite2-City.mmdb');
|
|
||||||
const dir = path.join(process.cwd(), 'geo');
|
const dir = path.join(process.cwd(), 'geo');
|
||||||
lookupPromise = maxmind.open(path.resolve(dir, 'GeoLite2-City.mmdb'));
|
lookupPromise = maxmind.open(path.resolve(dir, 'GeoLite2-City.mmdb'));
|
||||||
}
|
}
|
||||||
|
|
@ -121,8 +120,6 @@ export async function getLocation(ip: string, req: NextApiRequestCollect) {
|
||||||
const lookup = await getLookup();
|
const lookup = await getLookup();
|
||||||
const result = lookup.get(ip);
|
const result = lookup.get(ip);
|
||||||
|
|
||||||
console.log('debug_result:', result);
|
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
const country = result.country?.iso_code ?? result?.registered_country?.iso_code;
|
const country = result.country?.iso_code ?? result?.registered_country?.iso_code;
|
||||||
const subdivision1 = result.subdivisions?.[0]?.iso_code;
|
const subdivision1 = result.subdivisions?.[0]?.iso_code;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue