MCPcopy
hub / github.com/borgbackup/borg / __exit__

Method __exit__

src/borg/legacyremote.py:362–377  ·  view source on GitHub ↗
(self, exc_type, exc_val, exc_tb)

Source from the content-addressed store, hash-verified

360 return self
361
362 def __exit__(self, exc_type, exc_val, exc_tb):
363 try:
364 if exc_type is not None:
365 self.shutdown_time = time.monotonic() + 30
366 self.rollback()
367 finally:
368 # in any case, we want to close the repo cleanly, even if the
369 # rollback can not succeed (e.g. because the connection was
370 # already closed) and raised another exception:
371 logger.debug(
372 "LegacyRemoteRepository: %s bytes sent, %s bytes received, %d messages sent",
373 format_file_size(self.tx_bytes),
374 format_file_size(self.rx_bytes),
375 self.msgid,
376 )
377 self.close()
378
379 @property
380 def id_str(self):

Callers

nothing calls this directly

Calls 4

rollbackMethod · 0.95
closeMethod · 0.95
format_file_sizeFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected