Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make dupefilter support create from spider
- Loading branch information
zhouyanhui@kanzhun.com
committed
Jan 5, 2017
1 parent
500039b
commit 384996d
Showing
2 changed files
with
10 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,15 +134,7 @@ def open(self, spider): | |
raise ValueError("Failed to instantiate queue class '%s': %s", | ||
self.queue_cls, e) | ||
|
||
try: | ||
self.df = load_object(self.dupefilter_cls)( | ||
server=self.server, | ||
key=self.dupefilter_key % {'spider': spider.name}, | ||
debug=spider.settings.getbool('DUPEFILTER_DEBUG'), | ||
) | ||
except TypeError as e: | ||
raise ValueError("Failed to instantiate dupefilter class '%s': %s", | ||
self.dupefilter_cls, e) | ||
self.df = load_object(self.dupefilter_cls).from_spider(spider) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rmax
Owner
|
||
|
||
if self.flush_on_start: | ||
self.flush() | ||
|
why self.df moved out of try-except statement?