diff --git a/docker-compose.yaml b/docker-compose.yaml index 86fa9b9..5a3b5de 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,9 +5,9 @@ services: restart: unless-stopped environment: CONFIG_YAML: /app/config.yaml - DEBUGPY: "1" + DEBUG: "1" ports: - "5678:5678" volumes: - ./:/app - - ./config.yaml:/app/config.yaml:ro \ No newline at end of file + - ./config.yaml:/app/config.yaml:ro diff --git a/launch.json b/launch.json deleted file mode 100644 index 536e256..0000000 --- a/launch.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Attach to Docker (melesICUmover)", - "type": "python", - "request": "attach", - "connect": { - "host": "localhost", - "port": 5678 - } - } - ] -} diff --git a/main.py b/main.py index 19a79aa..9e99e4b 100644 --- a/main.py +++ b/main.py @@ -284,7 +284,7 @@ def job_set_status(cur, uuid: str, status: str, *, err: Optional[str] = None, pr processed_jpg_key = COALESCE(%s, processed_jpg_key), thumbnail_key = COALESCE(%s, thumbnail_key) WHERE image_uuid = %s; - """, (status, status, err, err, err, processed_key, thumb_key, uuid)) + """, (status, status, err, err, processed_key, thumb_key, uuid)) def insert_resource(cur, uuid: str, typ: str): @@ -317,12 +317,12 @@ def insert_metadata(cur, uuid: str, meta: dict): # NOTE: DateTimeLastSettings looks like "05:45:35 30.06.2025" in sample; parse if needed later. cur.execute(""" INSERT INTO remote_cam.metadata( - metadata_uuid, import_ts, ImageCreationDate, SizeInByte, ImageFormat, ImageNight, - DateTimeLastSettings, BatteryStatus, FirmwareVersion, SignalStrength, Temperature, - CoordinateSwitch, Latitude, Longitude, WorkPeriod, WorkStart, WorkEnd, ThumbnailSize, - PIRInterval, TimeScan, imei, iccid, INITKey, CameraName, CameraModel, CameraLanguage, - CameraNetwork, MobileNetworkCode, MobileCountryCode, LocationAreaCode, CustomerTimezone, - CustomerLanguage, servertime, ocr_ts + metadata_uuid, import_ts, "ImageCreationDate", "SizeInByte", "ImageFormat", "ImageNight", + "DateTimeLastSettings", "BatteryStatus", "FirmwareVersion", "SignalStrength", "Temperature", + "CoordinateSwitch", "Latitude", "Longitude", "WorkPeriod", "WorkStart", "WorkEnd", "ThumbnailSize", + "PIRInterval", "TimeScan", imei, iccid, "INITKey", "CameraName", "CameraModel", "CameraLanguage", + "CameraNetwork", "MobileNetworkCode", "MobileCountryCode", "LocationAreaCode", "CustomerTimezone", + "CustomerLanguage", servertime, ocr_ts ) VALUES ( %s, now(), %s, %s, %s, %s, %s, %s, %s, %s, %s, @@ -333,36 +333,36 @@ def insert_metadata(cur, uuid: str, meta: dict): ) ON CONFLICT (metadata_uuid) DO UPDATE SET import_ts = EXCLUDED.import_ts, - ImageCreationDate = EXCLUDED.ImageCreationDate, - SizeInByte = EXCLUDED.SizeInByte, - ImageFormat = EXCLUDED.ImageFormat, - ImageNight = EXCLUDED.ImageNight, - DateTimeLastSettings = EXCLUDED.DateTimeLastSettings, - BatteryStatus = EXCLUDED.BatteryStatus, - FirmwareVersion = EXCLUDED.FirmwareVersion, - SignalStrength = EXCLUDED.SignalStrength, - Temperature = EXCLUDED.Temperature, - CoordinateSwitch = EXCLUDED.CoordinateSwitch, - Latitude = EXCLUDED.Latitude, - Longitude = EXCLUDED.Longitude, - WorkPeriod = EXCLUDED.WorkPeriod, - WorkStart = EXCLUDED.WorkStart, - WorkEnd = EXCLUDED.WorkEnd, - ThumbnailSize = EXCLUDED.ThumbnailSize, - PIRInterval = EXCLUDED.PIRInterval, - TimeScan = EXCLUDED.TimeScan, + "ImageCreationDate" = EXCLUDED."ImageCreationDate", + "SizeInByte" = EXCLUDED."SizeInByte", + "ImageFormat" = EXCLUDED."ImageFormat", + "ImageNight" = EXCLUDED."ImageNight", + "DateTimeLastSettings" = EXCLUDED."DateTimeLastSettings", + "BatteryStatus" = EXCLUDED."BatteryStatus", + "FirmwareVersion" = EXCLUDED."FirmwareVersion", + "SignalStrength" = EXCLUDED."SignalStrength", + "Temperature" = EXCLUDED."Temperature", + "CoordinateSwitch" = EXCLUDED."CoordinateSwitch", + "Latitude" = EXCLUDED."Latitude", + "Longitude" = EXCLUDED."Longitude", + "WorkPeriod" = EXCLUDED."WorkPeriod", + "WorkStart" = EXCLUDED."WorkStart", + "WorkEnd" = EXCLUDED."WorkEnd", + "ThumbnailSize" = EXCLUDED."ThumbnailSize", + "PIRInterval" = EXCLUDED."PIRInterval", + "TimeScan" = EXCLUDED."TimeScan", imei = EXCLUDED.imei, iccid = EXCLUDED.iccid, - INITKey = EXCLUDED.INITKey, - CameraName = EXCLUDED.CameraName, - CameraModel = EXCLUDED.CameraModel, - CameraLanguage = EXCLUDED.CameraLanguage, - CameraNetwork = EXCLUDED.CameraNetwork, - MobileNetworkCode = EXCLUDED.MobileNetworkCode, - MobileCountryCode = EXCLUDED.MobileCountryCode, - LocationAreaCode = EXCLUDED.LocationAreaCode, - CustomerTimezone = EXCLUDED.CustomerTimezone, - CustomerLanguage = EXCLUDED.CustomerLanguage, + "INITKey" = EXCLUDED."INITKey", + "CameraName" = EXCLUDED."CameraName", + "CameraModel" = EXCLUDED."CameraModel", + "CameraLanguage" = EXCLUDED."CameraLanguage", + "CameraNetwork" = EXCLUDED."CameraNetwork", + "MobileNetworkCode" = EXCLUDED."MobileNetworkCode", + "MobileCountryCode" = EXCLUDED."MobileCountryCode", + "LocationAreaCode" = EXCLUDED."LocationAreaCode", + "CustomerTimezone" = EXCLUDED."CustomerTimezone", + "CustomerLanguage" = EXCLUDED."CustomerLanguage", servertime = EXCLUDED.servertime; """, ( uuid, icd, get("SizeInByte"), get("ImageFormat"), get("ImageNight"),