Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066256
D3014.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D3014.id.diff
View Options
diff --git a/swh/loader/package/loader.py b/swh/loader/package/loader.py
--- a/swh/loader/package/loader.py
+++ b/swh/loader/package/loader.py
@@ -40,6 +40,8 @@
class PackageLoader:
# Origin visit type (str) set by the loader
visit_type = ""
+ # Every packet of revisions, flush objects to storage
+ flush_nb_revisions = 10
def __init__(self, url):
"""Loader's constructor. This raises exception if the minimal required
@@ -319,6 +321,7 @@
load_exceptions = []
+ nb_revisions: int = 0
for version in self.get_versions(): # for each
logger.debug("version: %s", version)
tmp_revisions[version] = []
@@ -341,6 +344,13 @@
if revision_id is None:
continue
+ nb_revisions += 1
+ if (nb_revisions % self.flush_nb_revisions) == 0:
+ # first flush writing objects to storage
+ self.storage.flush()
+ # then clear remaining state from proxies (filter proxy)
+ self.storage.clear_buffers()
+
tmp_revisions[version].append((branch_name, revision_id))
if load_exceptions:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 5 2024, 4:17 AM (8 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3221333
Attached To
D3014: package.loader: Flush and clear regularly internal proxy storage states
Event Timeline
Log In to Comment