mirror of https://github.com/scrapy/scrapy.git
Line buffering (#7094)
This commit is contained in:
parent
804ae167df
commit
8c5fa6e6ae
|
|
@ -73,7 +73,11 @@ class RFPDupeFilter(BaseDupeFilter):
|
|||
self.debug = debug
|
||||
self.logger = logging.getLogger(__name__)
|
||||
if path:
|
||||
self.file = Path(path, "requests.seen").open("a+", encoding="utf-8")
|
||||
# line-by-line writing, see: https://github.com/scrapy/scrapy/issues/6019
|
||||
self.file = Path(path, "requests.seen").open(
|
||||
"a+", buffering=1, encoding="utf-8"
|
||||
)
|
||||
self.file.reconfigure(write_through=True)
|
||||
self.file.seek(0)
|
||||
self.fingerprints.update(x.rstrip() for x in self.file)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue