Commit 18777cf

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-07-01 12:48:50
style(history): improve logging
1 parent b097641
Changed files (2)
src
src/history/d1.py
@@ -126,7 +126,7 @@ async def backup_chat_history_to_d1(
             "gid": info["media_group_id"],
             "segmented": " ".join(cutter.cutword(info["text"])),
         }
-        logger.trace(f"Syncing {table_name}: {info['mid']}")
+        logger.trace(f"Syncing {table_name}: {info['mid']} - {info['time']}")
         tasks.append(query_d1(**insert_d1(table_name, records, update_on_conflict="mid"), db_name=HISTORY.D1_DATABASE, silent=True))
         if len(tasks) == concurrency:
             res = await asyncio.gather(*tasks, return_exceptions=True)
src/history/turso.py
@@ -126,7 +126,7 @@ async def backup_chat_history_to_turso(
             "gid": info["media_group_id"],
             "segmented": " ".join(cutter.cutword(info["text"])),
         }
-        logger.trace(f"Syncing {table_name}: {info['mid']}")
+        logger.trace(f"Syncing {table_name}: {info['mid']} - {info['time']}")
         statements.append(insert_statement(table_name, records, update_on_conflict="mid"))
         if len(statements) == concurrency:
             resp = await turso_exec(statements, silent=True, retry=2, **TURSO_KWARGS)