Skip to content

Commit 3d52d1f

Browse files
committed
PR clean up
1 parent 41d4060 commit 3d52d1f

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

universal-telemetry-software/cloud-sync/app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import logging
22
import time
33
from datetime import datetime, timezone
4-
from typing import Optional
54

65
from fastapi import BackgroundTasks, FastAPI, HTTPException
76
from fastapi.middleware.cors import CORSMiddleware

universal-telemetry-software/cloud-sync/sync.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import logging
1212
import time
13-
from datetime import datetime, timezone
13+
from datetime import datetime
1414
from typing import Callable, Optional, Set
1515

1616
import psycopg2
@@ -171,14 +171,14 @@ def ensure_cloud_table(self, cloud_conn) -> None:
171171
timescaledb.compress_orderby = 'time DESC'
172172
)
173173
""")
174-
except Exception:
175-
pass # Extension not available or already set — non-fatal
174+
except Exception as exc:
175+
logger.debug("Skipping compression setup for '%s': %s", self.cloud_table, exc)
176176
try:
177177
cur.execute("""
178178
SELECT add_compression_policy(%s, INTERVAL '2 days', if_not_exists => TRUE)
179179
""", (self.cloud_table,))
180-
except Exception:
181-
pass
180+
except Exception as exc:
181+
logger.debug("Skipping compression policy setup for '%s': %s", self.cloud_table, exc)
182182
cur.execute(
183183
f"CREATE INDEX IF NOT EXISTS {self.cloud_table}_time_idx "
184184
f"ON {self.cloud_table} (time DESC)"
@@ -322,11 +322,11 @@ def sync(self, progress_cb: Optional[Callable[[int, int], None]] = None) -> dict
322322
try:
323323
local_conn.close()
324324
except Exception:
325-
pass
325+
logger.debug("Ignoring error while closing local DB connection", exc_info=True)
326326
try:
327327
cloud_conn.close()
328328
except Exception:
329-
pass
329+
logger.debug("Ignoring error while closing cloud DB connection", exc_info=True)
330330

331331
elapsed = time.monotonic() - t0
332332
logger.info(f"Sync complete: {rows_synced} rows in {elapsed:.1f}s ({batches} batches)")

universal-telemetry-software/deploy/docker-compose.macbook-base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ services:
100100
networks:
101101
- datalink
102102

103-
# ── TimescaleDB (local, for received telemetry hot-load) ─────────────────
103+
# ── TimescaleDB (local, for received telemetry hot-load) ─────────────────
104104
timescaledb:
105105
image: timescale/timescaledb:latest-pg16
106106
container_name: daq-timescaledb

0 commit comments

Comments
 (0)