mirror of
https://github.com/borgbackup/borg.git
synced 2026-03-09 01:40:37 -04:00
Cache: do not try to release the lock twice
If Cache was already closed and __del__ was called, it called close() again and crashed when trying to release the lock again.
This commit is contained in:
parent
4ab4ecc7af
commit
d3fe74d4c0
1 changed files with 4 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ class Cache(object):
|
|||
|
||||
def __init__(self, repository, key, manifest, path=None, sync=True):
|
||||
self.timestamp = None
|
||||
self.lock = None
|
||||
self.txn_active = False
|
||||
self.repository = repository
|
||||
self.key = key
|
||||
|
|
@ -69,7 +70,9 @@ class Cache(object):
|
|||
self.files = None
|
||||
|
||||
def close(self):
|
||||
self.lock.release()
|
||||
if self.lock:
|
||||
self.lock.release()
|
||||
self.lock = None
|
||||
|
||||
def _read_files(self):
|
||||
self.files = {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue