Skip to content

Commit

Permalink
override http_port and bind_address
Browse files Browse the repository at this point in the history
with SCRAPYD_HTTP_PORT and SCRAPYD_BIND_ADDRESS
  • Loading branch information
fkromer committed Nov 29, 2023
1 parent 00e30f8 commit 2bc5732
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scrapyd/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import sys

from scrapy.utils.misc import load_object
Expand Down Expand Up @@ -36,7 +37,11 @@ def create_wrapped_resource(webcls, config, app):
def application(config):
app = Application("Scrapyd")
http_port = config.getint('http_port', 6800)
if os.environ.get("SCRAPYD_HTTP_PORT"):
http_port = int(os.environ["SCRAPYD_HTTP_PORT"])
bind_address = config.get('bind_address', '127.0.0.1')
if os.environ.get("SCRAPYD_BIND_ADDRESS"):
bind_address = int(os.environ["SCRAPYD_BIND_ADDRESS"])
poll_interval = config.getfloat('poll_interval', 5)

poller = QueuePoller(config)
Expand Down

0 comments on commit 2bc5732

Please sign in to comment.