Skip to content

Commit 58bcdd8

Browse files
committed
INTEGRITY: Improve some log messages.
1 parent ca19c09 commit 58bcdd8

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/app/fileset.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,9 +1589,15 @@ def mark_as_full(id):
15891589
try:
15901590
conn = db_connect()
15911591
with conn.cursor() as cursor:
1592+
user = f"cli:{getpass.getuser()}"
15921593
update_query = "UPDATE fileset SET status = 'full' WHERE id = %s"
15931594
cursor.execute(update_query, (id,))
1594-
create_log("Manual from Web", "Dev", f"Marked Fileset:{id} as full", conn)
1595+
create_log(
1596+
"Fileset marked full",
1597+
user,
1598+
f"Fileset:{id} marked as full by moderator: {user}",
1599+
conn,
1600+
)
15951601
conn.commit()
15961602
except Exception as e:
15971603
print(f"Error updating fileset status: {e}")

src/scripts/db_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,7 +2514,7 @@ def log_match_with_full(
25142514
category_text = "Mismatch with Full set"
25152515
if fully_matched:
25162516
category_text = "Existing as Full set."
2517-
log_text = f"""Files mismatched with Full Fileset:{candidate_id}. data_path: {relative_path}.Unmatched Files in scan fileset = {len(unmatched_scan_files)}. Unmatched Files in full fileset = {len(unmatched_candidate_files)}. List of unmatched files scan.dat : {", ".join(scan_file for scan_file in unmatched_scan_files)}, List of unmatched files full fileset : {", ".join(scan_file for scan_file in unmatched_candidate_files)}"""
2517+
log_text = f"""Files mismatched with Full Fileset:{candidate_id}. data_path: {relative_path} Unmatched Files in scan fileset: {len(unmatched_scan_files)} Unmatched Files in full fileset: {len(unmatched_candidate_files)} List of unmatched files scan.dat: {", ".join(scan_file for scan_file in unmatched_scan_files)} List of unmatched files full fileset: {", ".join(scan_file for scan_file in unmatched_candidate_files)}"""
25182518
if fully_matched:
25192519
log_text = (
25202520
f"Fileset matched completely with Full Fileset:{candidate_id}. Dropping."
@@ -2810,7 +2810,7 @@ def user_integrity_check(data, ip, game_metadata=None):
28102810
match_text = f"Candidates {', '.join(f'Fileset:{id}' for id in candidate_filesets)}"
28112811
if len(candidate_filesets) == 1:
28122812
match_text = f"Matched Fileset:{candidate_filesets[0]}"
2813-
log_text = f"Possible new variant Fileset:{user_fileset_id} from user. {match_text}"
2813+
log_text = f"Possible new variant Fileset:{user_fileset_id} from user. {match_text}. Match count: 1."
28142814
create_log(
28152815
category_text,
28162816
user,

0 commit comments

Comments
 (0)