Don't load geoip db in parallel

This commit is contained in:
shortcutme 2019-11-19 01:44:26 +01:00
parent e8af5db2e8
commit 4351af35f4
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import urllib.parse
import gevent import gevent
import util
from Config import config from Config import config
from Plugin import PluginManager from Plugin import PluginManager
from Debug import Debug from Debug import Debug
@ -629,6 +630,7 @@ class UiWebsocketPlugin(object):
loc_cache[ip] = loc loc_cache[ip] = loc
return loc return loc
@util.Noparallel()
def getGeoipDb(self): def getGeoipDb(self):
db_name = 'GeoLite2-City.mmdb' db_name = 'GeoLite2-City.mmdb'
@ -658,7 +660,6 @@ class UiWebsocketPlugin(object):
self.log.debug("Not showing peer locations: no GeoIP database") self.log.debug("Not showing peer locations: no GeoIP database")
return False return False
self.log.info("Loading GeoIP database from: %s" % db_path)
geodb = maxminddb.open_database(db_path) geodb = maxminddb.open_database(db_path)
peers = list(peers.values()) peers = list(peers.values())