From 218b945ba6cb93911a3425560cd97a951c3ba4cc Mon Sep 17 00:00:00 2001 From: gsd Date: Sun, 15 Feb 2026 21:33:32 +0300 Subject: [PATCH] t5 --- dbService.py | 5 +++-- service.py | 5 ++++- webExtensions/messageList.py | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dbService.py b/dbService.py index 9eac779..f9217ee 100644 --- a/dbService.py +++ b/dbService.py @@ -12,7 +12,7 @@ class MultiDeviceDbSupport: #return {"$or": [{"device_uuid": value}]} def deviceHash2Match(self, devices_hashes = []): - print(devices_hashes) + #print(devices_hashes) if devices_hashes == None: devices_hashes = [self.core.defaultDeviceUUIDHash] elif (type(devices_hashes) == list): @@ -23,7 +23,7 @@ class MultiDeviceDbSupport: if devices_hashes.__len__() == 0: devices_hashes = [self.core.defaultDeviceUUIDHash] - print(devices_hashes) + #print(devices_hashes) orPart = [] for hash in devices_hashes: uuid = self.core.devicesUuidHashToUuid.get(hash, "") @@ -34,6 +34,7 @@ class MultiDeviceDbSupport: return orPart#-->{"$or": orPart} class MessageDbService(MultiDeviceDbSupport): + MESSAGE_PORTNUM = 1 def __init__(self, dbStore, core): super().__init__(dbStore, core) diff --git a/service.py b/service.py index e2eb524..1297c11 100644 --- a/service.py +++ b/service.py @@ -216,7 +216,10 @@ class MongoDriver(MeshArgsParse): del v["user"] v["device_uuid"] = from_radio["device_uuid"] - await self.dbStore[k].insert_one(v) + try: + await self.dbStore[k].insert_one(v) + except: + logger.error("Cannot save packet to db", v) def tryParseProtobuf(self, v): try: diff --git a/webExtensions/messageList.py b/webExtensions/messageList.py index cec289e..cab8b54 100644 --- a/webExtensions/messageList.py +++ b/webExtensions/messageList.py @@ -8,7 +8,6 @@ from extra.MessageDTO import MessageDTO from typing import List, Annotated class WebExtension: - MESSAGE_PORTNUM = 1 app: FastAPI dbStore: AsyncDatabase def __init__(self, core):