| 3003 | |
| 3004 | |
| 3005 | def other_running_deep_scans( |
| 3006 | connection: sqlite3.Connection, current_scan_id: str |
| 3007 | ) -> list[dict[str, str]]: |
| 3008 | rows = connection.execute( |
| 3009 | """ |
| 3010 | SELECT id, target_path, phase, started_at, updated_at |
| 3011 | FROM scans |
| 3012 | WHERE mode = 'deep' AND status = 'running' AND id != ? |
| 3013 | ORDER BY updated_at DESC, started_at DESC, id |
| 3014 | """, |
| 3015 | (current_scan_id,), |
| 3016 | ) |
| 3017 | return [ |
| 3018 | { |
| 3019 | "phase": row["phase"], |
| 3020 | "scanId": row["id"], |
| 3021 | "startedAt": row["started_at"], |
| 3022 | "targetPath": row["target_path"], |
| 3023 | "updatedAt": row["updated_at"], |
| 3024 | } |
| 3025 | for row in rows |
| 3026 | ] |
| 3027 | |
| 3028 | |
| 3029 | def list_findings(connection: sqlite3.Connection, args: argparse.Namespace) -> dict[str, Any]: |