MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / mark_scan_interrupted

Method mark_scan_interrupted

db_manager.py:2089–2113  ·  view source on GitHub ↗

Mark a scan as interrupted (failed due to system restart). Args: scan_id: Scan ID to mark as interrupted Returns: bool: True if successful

(self, scan_id: str)

Source from the content-addressed store, hash-verified

2087 result['options'] = {}
2088 results.append(result)
2089
2090 return results
2091 except Exception as e:
2092 logger.error(f"Failed to get interrupted scans: {e}")
2093 return []
2094
2095 def mark_scan_interrupted(self, scan_id: str) -> bool:
2096 """
2097 Mark a scan as interrupted (failed due to system restart).
2098
2099 Args:
2100 scan_id: Scan ID to mark as interrupted
2101
2102 Returns:
2103 bool: True if successful
2104 """
2105 try:
2106 with self.get_connection() as conn:
2107 cursor = conn.cursor()
2108 cursor.execute("""
2109 UPDATE scan_jobs
2110 SET status = 'interrupted',
2111 error_message = 'Scan interrupted by system restart',
2112 updated_at = CURRENT_TIMESTAMP
2113 WHERE scan_id = ?
2114 """, (scan_id,))
2115 conn.commit()
2116 return cursor.rowcount > 0

Callers 1

Calls 5

get_connectionMethod · 0.95
cursorMethod · 0.80
commitMethod · 0.80
errorMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected