mirror of https://github.com/borgbackup/borg.git
release lock properly if segment conversion crashes
This commit is contained in:
parent
3bb3bd45fc
commit
6a72252b69
|
@ -27,9 +27,11 @@ class AtticRepositoryConverter(Repository):
|
|||
# partial open: just hold on to the lock
|
||||
self.lock = UpgradableLock(os.path.join(self.path, 'lock'),
|
||||
exclusive=True).acquire()
|
||||
self.convert_segments(segments, dryrun)
|
||||
self.lock.release()
|
||||
self.lock = None
|
||||
try:
|
||||
self.convert_segments(segments, dryrun)
|
||||
finally:
|
||||
self.lock.release()
|
||||
self.lock = None
|
||||
self.convert_cache(dryrun)
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in New Issue