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

Commit

Permalink
g object cannot deepcopy
Browse files Browse the repository at this point in the history
  • Loading branch information
binux committed Aug 18, 2016
1 parent cf06fc5 commit ac24604
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pyspider/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def webui(ctx, host, port, cdn, scheduler_rpc, fetcher_rpc, max_rate, max_burst,
else:
# get fetcher instance for webui
fetcher_config = g.config.get('fetcher', {})
mock_g = copy.deepcopy(g)
mock_g = copy.copy(g)
mock_g['scheduler2fetcher'] = None
mock_g['fetcher2processor'] = None
webui_fetcher = ctx.invoke(fetcher, async=False, get_object=True, g=mock_g, **fetcher_config)
Expand Down Expand Up @@ -600,8 +600,6 @@ def clear_project():
% g.config.get('scheduler', {}).get('xmlrpc_port', 23333))
threads.append(run_in(ctx.invoke, webui, **webui_config))

time.sleep(1)

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

0 comments on commit ac24604

Please sign in to comment.