diff --git a/paddlehub/common/hub_server.py b/paddlehub/common/hub_server.py index 8e1169470c1cdb6c91297eba187bddc4f8c33c9b..5535b9148c983de27a48daf9942ddc4b5e3d8000 100644 --- a/paddlehub/common/hub_server.py +++ b/paddlehub/common/hub_server.py @@ -24,7 +24,6 @@ import requests import json import yaml import random -import fcntl from random import randint from paddlehub.common import utils, srv_utils @@ -39,9 +38,6 @@ CACHE_TIME = 60 * 10 class HubServer(object): def __init__(self, config_file_path=None): - LOCK_FILE = os.path.join(hub.HUB_HOME, '__LOCK__') - LOCK_FP = open(LOCK_FILE, 'a+') - fcntl.flock(LOCK_FP.fileno(), fcntl.LOCK_EX) if not config_file_path: config_file_path = os.path.join(hub.CONF_HOME, 'config.json') if not os.path.exists(hub.CONF_HOME): @@ -57,7 +53,6 @@ class HubServer(object): self.server_url = self.config['server_url'] self.request() self._load_resource_list_file_if_valid() - LOCK_FP.close() def get_server_url(self): random.seed(int(time.time())) diff --git a/paddlehub/common/logger.py b/paddlehub/common/logger.py index 24a281d632bc850ca1d455e4674a6c5dd665379e..65596cb7adcb6313023f62487e12d9194f2baaa1 100644 --- a/paddlehub/common/logger.py +++ b/paddlehub/common/logger.py @@ -43,7 +43,7 @@ class Logger(object): self.logger.setLevel(self._get_logging_level()) if os.path.exists(os.path.join(CONF_HOME, "config.json")): with open(os.path.join(CONF_HOME, "config.json"), "r") as fp: - level = json.load(fp).get("log_level") + level = json.load(fp).get("log_level", "DEBUG") self.logLevel = level self.setLevel(level)