Don't load geoip db in parallel
This commit is contained in:
parent
e8af5db2e8
commit
4351af35f4
|
@ -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())
|
||||||
|
|
Loading…
Reference in New Issue