Import global maxminddb module

This commit is contained in:
shortcutme 2019-03-16 04:26:27 +01:00
parent f331f5e92c
commit 02e67a901f
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -625,7 +625,7 @@ class UiWebsocketPlugin(object):
return loc return loc
def getPeerLocations(self, peers): def getPeerLocations(self, peers):
from . import maxminddb import maxminddb
db_path = config.data_dir + '/GeoLite2-City.mmdb' db_path = config.data_dir + '/GeoLite2-City.mmdb'
if not os.path.isfile(db_path) or os.path.getsize(db_path) == 0: if not os.path.isfile(db_path) or os.path.getsize(db_path) == 0:
if not self.downloadGeoLiteDb(db_path): if not self.downloadGeoLiteDb(db_path):