mirror of https://github.com/scrapy/scrapy.git
Do leveldb compactation for the httpcache on closing.
This commit is contained in:
parent
a2dbde98d5
commit
b285cebcbf
|
|
@ -302,6 +302,9 @@ class LeveldbCacheStorage(object):
|
|||
self.db = self._leveldb.LevelDB(dbpath)
|
||||
|
||||
def close_spider(self, spider):
|
||||
# Do compactation each time to save space and also recreate files to
|
||||
# avoid them being removed in storages with timestamp-based autoremoval.
|
||||
self.db.CompactRange()
|
||||
del self.db
|
||||
|
||||
def retrieve_response(self, spider, request):
|
||||
|
|
|
|||
Loading…
Reference in New Issue