Copy additional backup locations in jobs (#5890)

Instead of copying the backup in the main job, lets copy them in
separate job per location. This allows to use the same backup error
handling mechanism as for add-ons and folders.

This makes the stage introduced in #5784 somewhat redundant, but
before removing it, let's see if this approach works out.
This commit is contained in:
Stefan Agner
2025-05-20 15:18:23 +02:00
committed by GitHub
parent bac7c21fe8
commit b5a7e521ae
2 changed files with 73 additions and 60 deletions

View File

@@ -729,11 +729,26 @@ async def test_backup_to_multiple_locations_error_on_copy(
assert result["data"]["jobs"][0]["name"] == f"backup_manager_{backup_type}_backup"
assert result["data"]["jobs"][0]["reference"] == slug
assert result["data"]["jobs"][0]["done"] is True
assert result["data"]["jobs"][0]["errors"] == [
assert len(result["data"]["jobs"][0]["errors"]) == 0
# Errors during copy to additional location should be recorded in child jobs only.
assert (
result["data"]["jobs"][0]["child_jobs"][-1]["name"]
== "backup_copy_to_additional_locations"
)
assert (
result["data"]["jobs"][0]["child_jobs"][-1]["child_jobs"][0]["name"]
== "backup_copy_to_location"
)
assert (
result["data"]["jobs"][0]["child_jobs"][-1]["child_jobs"][0]["reference"]
== ".cloud_backup"
)
assert result["data"]["jobs"][0]["child_jobs"][-1]["child_jobs"][0]["errors"] == [
{
"type": "BackupError",
"message": "Could not copy backup to .cloud_backup due to: ",
"stage": "copy_additional_locations",
"stage": None,
}
]