mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-11-05 04:12:10 +00:00
fix(monitor): read the error frequency for AI context from the real errors table columns
This commit is contained in:
@@ -165,22 +165,16 @@ def get_event_frequency(error_id: str = None, error_key: str = None,
|
|||||||
try:
|
try:
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
# Try to find the error
|
# Try to find the error. The errors table keys a row by error_key.
|
||||||
if error_id:
|
if error_id or error_key:
|
||||||
cursor.execute('''
|
cursor.execute('''
|
||||||
SELECT first_seen, last_seen, occurrences, category
|
SELECT first_seen, last_seen, occurrence_count, category
|
||||||
FROM errors WHERE error_key = ? OR error_id = ?
|
|
||||||
ORDER BY last_seen DESC LIMIT 1
|
|
||||||
''', (error_id, error_id))
|
|
||||||
elif error_key:
|
|
||||||
cursor.execute('''
|
|
||||||
SELECT first_seen, last_seen, occurrences, category
|
|
||||||
FROM errors WHERE error_key = ?
|
FROM errors WHERE error_key = ?
|
||||||
ORDER BY last_seen DESC LIMIT 1
|
ORDER BY last_seen DESC LIMIT 1
|
||||||
''', (error_key,))
|
''', (error_id or error_key,))
|
||||||
elif category:
|
elif category:
|
||||||
cursor.execute('''
|
cursor.execute('''
|
||||||
SELECT first_seen, last_seen, occurrences, category
|
SELECT first_seen, last_seen, occurrence_count, category
|
||||||
FROM errors WHERE category = ? AND resolved_at IS NULL
|
FROM errors WHERE category = ? AND resolved_at IS NULL
|
||||||
ORDER BY last_seen DESC LIMIT 1
|
ORDER BY last_seen DESC LIMIT 1
|
||||||
''', (category,))
|
''', (category,))
|
||||||
|
|||||||
Reference in New Issue
Block a user