diff --git a/repeater/data_acquisition/storage_collector.py b/repeater/data_acquisition/storage_collector.py index fbce9a3..9e49d4e 100644 --- a/repeater/data_acquisition/storage_collector.py +++ b/repeater/data_acquisition/storage_collector.py @@ -198,7 +198,8 @@ class StorageCollector: Node name if found, None otherwise """ try: - with self.sqlite_handler.get_connection() as conn: + import sqlite3 + with sqlite3.connect(self.sqlite_handler.sqlite_path) as conn: result = conn.execute( "SELECT node_name FROM adverts WHERE pubkey = ? AND node_name IS NOT NULL ORDER BY last_seen DESC LIMIT 1", (pubkey,) diff --git a/repeater/handler_helpers/room_server.py b/repeater/handler_helpers/room_server.py index 6f6ecdf..178ba15 100644 --- a/repeater/handler_helpers/room_server.py +++ b/repeater/handler_helpers/room_server.py @@ -500,15 +500,11 @@ class RoomServer: # Get all clients for this room all_clients = self.acl.get_all_clients() if not all_clients: - logger.debug(f"Room '{self.room_name}': No authenticated clients found") + # Only log once when transitioning from clients to no clients + # to avoid log spam when room is idle self.next_push_time = time.time() + 1.0 # Check again in 1 second continue - logger.debug( - f"Room '{self.room_name}': Found {len(all_clients)} authenticated client(s), " - f"checking for unsynced messages" - ) - # SAFETY: Limit number of clients if len(all_clients) > MAX_CLIENTS_PER_ROOM: logger.warning( @@ -573,12 +569,6 @@ class RoomServer: last_activity=time.time() ) - # Log the sync check for debugging - logger.debug( - f"Room '{self.room_name}': Checking client 0x{client.id.get_public_key()[0]:02X} " - f"for messages newer than sync_since={sync_since:.1f}" - ) - # Find next unsynced message for this client unsynced = self.db.get_unsynced_messages( room_hash=f"0x{self.room_hash:02X}",