mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-23 09:16:51 +00:00
fix(backups): robustness against stale locks: snapshot sizing
This commit is contained in:
parent
26ab7b4d7b
commit
0eb70e1551
|
@ -335,6 +335,7 @@ class ResticBackupper(AbstractBackupper):
|
||||||
with subprocess.Popen(
|
with subprocess.Popen(
|
||||||
command,
|
command,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
shell=False,
|
shell=False,
|
||||||
) as handle:
|
) as handle:
|
||||||
output = handle.communicate()[0].decode("utf-8")
|
output = handle.communicate()[0].decode("utf-8")
|
||||||
|
@ -382,7 +383,10 @@ class ResticBackupper(AbstractBackupper):
|
||||||
)
|
)
|
||||||
|
|
||||||
with subprocess.Popen(
|
with subprocess.Popen(
|
||||||
restore_command, stdout=subprocess.PIPE, shell=False
|
restore_command,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
|
shell=False,
|
||||||
) as handle:
|
) as handle:
|
||||||
|
|
||||||
# for some reason restore does not support
|
# for some reason restore does not support
|
||||||
|
|
|
@ -791,6 +791,9 @@ def test_operations_while_locked(backups, dummy_service):
|
||||||
# using lowlevel to make sure no caching interferes
|
# using lowlevel to make sure no caching interferes
|
||||||
assert Backups.provider().backupper.is_initted() is True
|
assert Backups.provider().backupper.is_initted() is True
|
||||||
|
|
||||||
|
Backups.provider().backupper.lock()
|
||||||
|
assert Backups.snapshot_restored_size(snap.id) > 0
|
||||||
|
|
||||||
# check that no locks were left
|
# check that no locks were left
|
||||||
Backups.provider().backupper.lock()
|
Backups.provider().backupper.lock()
|
||||||
Backups.provider().backupper.unlock()
|
Backups.provider().backupper.unlock()
|
||||||
|
|
Loading…
Reference in a new issue