update retention policy to a maximum of 2 days for completed archives and adjust related configurations
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from app.db import Database
|
||||
|
||||
|
||||
@@ -62,12 +64,15 @@ def test_sqlite_lease_claims_one_queued_job(tmp_path) -> None:
|
||||
"files_written": 1,
|
||||
},
|
||||
warnings=[],
|
||||
retention_days=1,
|
||||
retention_days=30,
|
||||
)
|
||||
ready = database.get_job(job["id"])
|
||||
assert ready is not None
|
||||
assert ready["state"] == "ready"
|
||||
assert ready["expires_at"] > ready["completed_at"]
|
||||
expires_at = datetime.fromisoformat(ready["expires_at"])
|
||||
completed_at = datetime.fromisoformat(ready["completed_at"])
|
||||
assert expires_at - completed_at <= timedelta(days=2)
|
||||
|
||||
|
||||
def test_worker_cannot_cancel_without_a_user_cancellation_request(tmp_path) -> None:
|
||||
|
||||
Reference in New Issue
Block a user