Compare commits

...
Author SHA1 Message Date
spark a30b04ae34 fix(ingest): repair the winter clock on desktop previews too
ci / rust (pull_request) Successful in 9m22s
ci / typescript (pull_request) Successful in 14m50s
The live photos stay on the photographer's computer. The preview the server kept still has the camera clock, so the hour repair has to read that file.
2026-11-07 16:16:08 +00:00
2 changed files with 7 additions and 8 deletions

No files matched your search

+5 -6
View File
@@ -497,19 +497,18 @@ export class IngestService {
}
/**
* Photos stored an hour early because the camera still writes +01:00 in winter. Re-read the file with the
* current clock rules and, when it moves by that hour, put the capture time right and let the autopilot
* decide the frame again.
* Photos stored an hour early because the camera still writes +01:00 in winter. Re-read the stored file
* (the original, or the preview the desktop sent, which keeps the camera's clock) and, when it moves by
* that hour, put the capture time right and let the autopilot decide the frame again.
*/
async backfillCaptureClock(limit = 40): Promise<number> {
async backfillCaptureClock(limit = 100): Promise<number> {
const { db, storage, log } = this.deps;
const rows = await db.$queryRaw<
Array<{ id: string; storage_key: string; captured_at: Date | null; taken_at: Date; autopilot: unknown; exif: unknown }>
>`
SELECT id, storage_key, captured_at, taken_at, autopilot, exif
FROM photos
WHERE original_stored
AND status = 'READY'
WHERE status = 'READY'
AND created_at > now() - interval '3 days'
AND (
exif IS NULL
+2 -2
View File
@@ -186,10 +186,10 @@ invoices.start();
// Photos that arrived before on-camera stars were read: apply Rating from the original in storage.
const ratingBackfill = setInterval(() => {
void ingest.backfillCameraRatings(25).catch((err) => log.warn({ err }, "ingest: camera rating backfill failed"));
void ingest.backfillCaptureClock(40).catch((err) => log.warn({ err }, "ingest: capture clock repair failed"));
void ingest.backfillCaptureClock(100).catch((err) => log.warn({ err }, "ingest: capture clock repair failed"));
}, 60_000);
void ingest.backfillCameraRatings(25).catch((err) => log.warn({ err }, "ingest: camera rating backfill failed"));
void ingest.backfillCaptureClock(40).catch((err) => log.warn({ err }, "ingest: capture clock repair failed"));
void ingest.backfillCaptureClock(100).catch((err) => log.warn({ err }, "ingest: capture clock repair failed"));
log.info({ ingestRoot: config.INGEST_ROOT, storage: config.STORAGE_ROOT }, "worker started");
/** Drain in-flight jobs before ending the Prisma/pg pool (BIT-31189). Leave headroom under PM2 kill_timeout. */