From 0c42bb70cd5724c7bfade114107fee41d16e6912 Mon Sep 17 00:00:00 2001 From: suqingdong Date: Mon, 9 Sep 2019 12:50:06 +0800 Subject: [PATCH] update settings.py --- Config/setting.py | 28 +++++++++++++++------------- Schedule/ProxyRefreshSchedule.py | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Config/setting.py b/Config/setting.py index a74e69a32..d27062f12 100644 --- a/Config/setting.py +++ b/Config/setting.py @@ -23,7 +23,7 @@ class ConfigError(BaseException): if DB_TYPE == 'SSDB': DB_HOST = getenv('ssdb_host', '127.0.0.1') - DB_PORT = getenv('ssdb_port', '6379') + DB_PORT = getenv('ssdb_port', '8866') elif DB_TYPE == 'MONGODB': DB_HOST = getenv('mongodb_host', '127.0.0.1') DB_PORT = getenv('mongodb_host', '27017') @@ -44,18 +44,20 @@ class ConfigError(BaseException): # register the proxy getter function PROXY_GETTER = [ - "freeProxyFirst", - "freeProxySecond", - # "freeProxyThird", # 网站已不能访问 - "freeProxyFourth", - "freeProxyFifth", - # "freeProxySixth" # 不再提供免费代理 - "freeProxySeventh", - # "freeProxyEight", - # "freeProxyNinth", - "freeProxyTen", - "freeProxyEleven", - "freeProxyTwelve", + "freeProxy01", + "freeProxy02", + # "freeProxy03", # 网站已不能访问 + "freeProxy04", + "freeProxy05", + # "freeProxy06" # 不再提供免费代理 + "freeProxy07", + # "freeProxy08", + # "freeProxy09", + "freeProxy10", + "freeProxy11", + "freeProxy12", + "freeProxy13", + "freeProxy14", # foreign website, outside the wall # "freeProxyWallFirst", # "freeProxyWallSecond", diff --git a/Schedule/ProxyRefreshSchedule.py b/Schedule/ProxyRefreshSchedule.py index a61cc5a25..c9c8a6416 100644 --- a/Schedule/ProxyRefreshSchedule.py +++ b/Schedule/ProxyRefreshSchedule.py @@ -97,7 +97,7 @@ def fetchAll(): def run(): scheduler = BackgroundScheduler() # 不用太快, 网站更新速度比较慢, 太快会加大验证压力, 导致raw_proxy积压 - scheduler.add_job(fetchAll, 'interval', minutes=10, id="fetch_proxy") + scheduler.add_job(fetchAll, 'interval', minutes=5, id="fetch_proxy") scheduler.add_job(batchRefresh, "interval", minutes=1) # 每分钟检查一次 scheduler.start()