Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

#895 Fix starting multiple fetchers causing fetcher.xmlrpc port confl… #897

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pyspider/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,10 @@ def all(ctx, fetcher_num, processor_num, result_worker_num, run_in):
# fetcher
fetcher_config = g.config.get('fetcher', {})
fetcher_config.setdefault('xmlrpc_host', '127.0.0.1')
for i in range(fetcher_num):
threads.append(run_in(ctx.invoke, fetcher, **fetcher_config))
threads.append(run_in(ctx.invoke, fetcher, **fetcher_config))
for i in range(1, fetcher_num):
fetcher_obj = ctx.invoke(fetcher, get_object=True, **fetcher_config)
threads.append(run_in(fetcher_obj.run))

# scheduler
scheduler_config = g.config.get('scheduler', {})
Expand Down