Refactor environment variables and remove unused launch configuration
This commit is contained in:
parent
400f8a53f8
commit
1e4a7b86b6
@ -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
|
||||
- ./config.yaml:/app/config.yaml:ro
|
||||
|
||||
14
launch.json
14
launch.json
@ -1,14 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Attach to Docker (melesICUmover)",
|
||||
"type": "python",
|
||||
"request": "attach",
|
||||
"connect": {
|
||||
"host": "localhost",
|
||||
"port": 5678
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
70
main.py
70
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"),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user