33 lines
1.8 KiB
JSON
33 lines
1.8 KiB
JSON
{
|
|
"db_name": "SQLite",
|
|
"query": "\n SELECT ta.id as \"attempt_id!: Uuid\", ta.container_ref, p.git_repo_path as \"git_repo_path!\"\n FROM task_attempts ta\n LEFT JOIN execution_processes ep ON ta.id = ep.task_attempt_id AND ep.completed_at IS NOT NULL\n JOIN tasks t ON ta.task_id = t.id\n JOIN projects p ON t.project_id = p.id\n WHERE ta.worktree_deleted = FALSE\n -- Exclude attempts with any running processes (in progress)\n AND ta.id NOT IN (\n SELECT DISTINCT ep2.task_attempt_id\n FROM execution_processes ep2\n WHERE ep2.completed_at IS NULL\n )\n GROUP BY ta.id, ta.container_ref, p.git_repo_path, ta.updated_at\n HAVING datetime('now', '-72 hours') > datetime(\n MAX(\n CASE\n WHEN ep.completed_at IS NOT NULL THEN ep.completed_at\n ELSE ta.updated_at\n END\n )\n )\n ORDER BY MAX(\n CASE\n WHEN ep.completed_at IS NOT NULL THEN ep.completed_at\n ELSE ta.updated_at\n END\n ) ASC\n ",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"name": "attempt_id!: Uuid",
|
|
"ordinal": 0,
|
|
"type_info": "Blob"
|
|
},
|
|
{
|
|
"name": "container_ref",
|
|
"ordinal": 1,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "git_repo_path!",
|
|
"ordinal": 2,
|
|
"type_info": "Text"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Right": 0
|
|
},
|
|
"nullable": [
|
|
true,
|
|
true,
|
|
true
|
|
]
|
|
},
|
|
"hash": "4e9e0acca10277c51bb132d71946e3da50286e7873807cc0e96a3243e3c18449"
|
|
}
|