Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 20d16f9

Browse files
author
Germey
committed
fix
1 parent ad82d46 commit 20d16f9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

‎proxypool/scheduler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from proxypool.processors.server import app
44
from proxypool.processors.getter import Getter
55
from proxypool.processors.tester import Tester
6-
from proxypool.setting import CYCLE_GETTER, CYCLE_TESTER, API_HOST, \
6+
from proxypool.setting import APP_PROD_METHOD_GEVENT, APP_PROD_METHOD_MEINHELD, APP_PROD_METHOD_TORNADO, CYCLE_GETTER, CYCLE_TESTER, API_HOST, \
77
API_THREADED, API_PORT, ENABLE_SERVER, IS_PROD, APP_PROD_METHOD, \
88
ENABLE_GETTER, ENABLE_TESTER, IS_WINDOWS
99
from loguru import logger
@@ -58,7 +58,7 @@ def run_server(self):
5858
logger.info('server not enabled, exit')
5959
return
6060
if IS_PROD:
61-
if APP_PROD_METHOD == 'gevent':
61+
if APP_PROD_METHOD == APP_PROD_METHOD_GEVENT:
6262
try:
6363
from gevent.pywsgi import WSGIServer
6464
except ImportError as e:
@@ -67,7 +67,7 @@ def run_server(self):
6767
http_server = WSGIServer((API_HOST, API_PORT), app)
6868
http_server.serve_forever()
6969

70-
elif APP_PROD_METHOD == 'tornado':
70+
elif APP_PROD_METHOD == APP_PROD_METHOD_TORNADO:
7171
try:
7272
from tornado.wsgi import WSGIContainer
7373
from tornado.httpserver import HTTPServer
@@ -79,7 +79,7 @@ def run_server(self):
7979
http_server.listen(API_PORT)
8080
IOLoop.instance().start()
8181

82-
elif APP_PROD_METHOD == "meinheld":
82+
elif APP_PROD_METHOD == APP_PROD_METHOD_MEINHELD:
8383
try:
8484
import meinheld
8585
except ImportError as e:

‎proxypool/setting.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
# - gevent: pip install gevent
2727
# - tornado: pip install tornado
2828
# - meinheld: pip install meinheld
29-
APP_PROD_METHOD = env.str('APP_PROD_METHOD', "gevent").lower()
29+
APP_PROD_METHOD_GEVENT = 'gevent'
30+
APP_PROD_METHOD_TORNADO = 'tornado'
31+
APP_PROD_METHOD_MEINHELD = 'meinheld'
32+
APP_PROD_METHOD = env.str('APP_PROD_METHOD', APP_PROD_METHOD_GEVENT).lower()
3033

3134
# redis host
3235
REDIS_HOST = env.str('PROXYPOOL_REDIS_HOST',

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /