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

Method __exit__

wal_e/worker/prefetch.py:46–59  ·  view source on GitHub ↗
(self, exc_type, exc_val, exc_tb)

Source from the content-addressed store, hash-verified

44 return self
45
46 def __exit__(self, exc_type, exc_val, exc_tb):
47 try:
48 if exc_type is None:
49 # Success. Mark the segment as complete.
50 #
51 # In event of a crash, this os.link() without an fsync
52 # can leave a corrupt file in the prefetch directory,
53 # but given Postgres retries corrupt archive logs
54 # (because it itself makes no provisions to sync
55 # them), that is assumed to be acceptable.
56 os.link(self.tf.name, path.join(
57 self.prefetch_dir.prefetched_dir, self.segment.name))
58 finally:
59 shutil.rmtree(self.prefetch_dir.seg_dir(self.segment))
60
61
62class Dirs(object):

Callers

nothing calls this directly

Calls 2

seg_dirMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected