mirror of https://github.com/scrapy/scrapy.git
scrapyd: force application to receive config as argument
This commit is contained in:
parent
85890a5092
commit
c02d6db6a3
|
|
@ -1,8 +1,9 @@
|
|||
from scrapy.utils.misc import load_object
|
||||
from .config import Config
|
||||
|
||||
def get_application():
|
||||
config = Config()
|
||||
def get_application(config=None):
|
||||
if config is None:
|
||||
config = Config()
|
||||
apppath = config.get('application', 'scrapyd.app.application')
|
||||
appfunc = load_object(apppath)
|
||||
return appfunc()
|
||||
return appfunc(config)
|
||||
|
|
|
|||
|
|
@ -11,9 +11,8 @@ from .environ import Environment
|
|||
from .website import Root
|
||||
from .config import Config
|
||||
|
||||
def application():
|
||||
def application(config):
|
||||
app = Application("Scrapyd")
|
||||
config = Config()
|
||||
http_port = config.getint('http_port', 6800)
|
||||
|
||||
poller = QueuePoller(config)
|
||||
|
|
|
|||
Loading…
Reference in New Issue