MCPcopy Create free account
hub / github.com/wal-e/wal-e / clear

Method clear

wal_e/worker/prefetch.py:130–140  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128 lackadaisical_mkdir(self.seg_dir(segment))
129
130 def clear(self):
131 def warn_on_cant_remove(function, path, excinfo):
132 # Not really expected, so until complaints come in, just
133 # dump a ton of information.
134 logger.warning(
135 msg='cannot clear prefetch data',
136 detail='{0!r}\n{1!r}\n{2!r}'.format(function, path, excinfo),
137 hint=('Report this as a bug: '
138 'a better error message should be written.'))
139
140 shutil.rmtree(self.prefetched_dir, False, warn_on_cant_remove)
141
142 def clear_except(self, retained_segments):
143 sn = set(s.name for s in retained_segments)

Callers 2

test_atomic_downloadFunction · 0.80
test_clear_errorFunction · 0.80

Calls

no outgoing calls

Tested by 2

test_atomic_downloadFunction · 0.64
test_clear_errorFunction · 0.64