Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/provenance.py
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
class Provenance: | class Provenance: | ||||
def __init__(self, storage: ProvenanceStorageInterface) -> None: | def __init__(self, storage: ProvenanceStorageInterface) -> None: | ||||
self.storage = storage | self.storage = storage | ||||
self.cache = new_cache() | self.cache = new_cache() | ||||
def clear_caches(self) -> None: | def clear_caches(self) -> None: | ||||
self.cache = new_cache() | self.cache = new_cache() | ||||
def close(self) -> None: | |||||
self.storage.close() | |||||
def flush(self) -> None: | def flush(self) -> None: | ||||
# Revision-content layer insertions ############################################ | # Revision-content layer insertions ############################################ | ||||
# After relations, dates for the entities can be safely set, acknowledging that | # After relations, dates for the entities can be safely set, acknowledging that | ||||
# these entities won't need to be reprocessed in case of failure. | # these entities won't need to be reprocessed in case of failure. | ||||
cnts = { | cnts = { | ||||
src | src | ||||
for src, _, _ in self.cache["content_in_revision"] | for src, _, _ in self.cache["content_in_revision"] | ||||
▲ Show 20 Lines • Show All 305 Lines • Show Last 20 Lines |