fix(dates): resume cursor so unconvertible rows can't stall the #118 drain
Review follow-up: rows that exist but can't be faithfully resolved spent the cap and were re-collected first every tick. Carry a per-library cursor across ticks (wrapping at end of table), share the cap parser between the two date drains, and name the conversion tuple. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
98db2a48db
commit
fcaf8487c2
3 files changed
+153
-43
No files matched your search
@@ -349,6 +349,9 @@ pub fn watch_files(
|
||||
// Last-known per-library remaining count behind the
|
||||
// `imageserver_date_backfill_remaining` gauge.
|
||||
let mut utc_backfill_remaining: HashMap<i32, i64> = HashMap::new();
|
||||
// Per-library resume cursor for the true-instant drain; in-memory,
|
||||
// so a restart resumes from 0 (harmless — the drain is idempotent).
|
||||
let mut utc_backfill_cursors: HashMap<i32, i32> = HashMap::new();
|
||||
|
||||
let mut last_quick_scan = SystemTime::now();
|
||||
// Initialize to UNIX_EPOCH so the *first* tick is treated as a
|
||||
@@ -530,6 +533,7 @@ pub fn watch_files(
|
||||
&exif_dao,
|
||||
&precomputed_reel_dao,
|
||||
&display_tz,
|
||||
utc_backfill_cursors.entry(lib.id).or_insert(0),
|
||||
);
|
||||
backfill::refresh_utc_backfill_progress(
|
||||
&context,
|
||||
|
||||
Reference in new issue
Block a user