feat(backend): add JOB_RETENTION_SECS to delete completed jobs completed after expiration period

This commit is contained in:
Ruben Fiszel
2023-04-26 19:34:54 +02:00
parent 6edc7d9978
commit 1d1c812e36
4 changed files with 32 additions and 7 deletions

View File

@@ -1945,6 +1945,26 @@
},
"query": "INSERT INTO pip_resolution_cache (hash, lockfile, expiration) VALUES ($1, $2, now() + ('3 days')::interval) ON CONFLICT (hash) DO UPDATE SET lockfile = $2"
},
"502781c4e2fc692db7a66b850450a1934b2403a5cff0421fe9609f9b99d8ee95": {
"describe": {
"columns": [
{
"name": "id",
"ordinal": 0,
"type_info": "Uuid"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "DELETE FROM completed_job WHERE started_at + ((duration_ms/1000 + $1) || ' s')::interval <= now() RETURNING id"
},
"5061c0d054bf4f028e7fe51a8f9389024c6ae4492755cadac0f7167e5300bda0": {
"describe": {
"columns": [],