6b72ef03acb93eaadce3b44b649d494183a54dd7
Two related hardening fixes for the input folder poller (bug #22): 1. Partial-write protection. A freshly-dropped .mkv now has to present the same (mtime, size) on two consecutive ticks before processFn is called. A file mid-rsync that grows or has a moving mtime is skipped until it settles. The per-file (mtime, size) state lives in Watcher.seen and is rebuilt from the current glob each tick so the map cannot grow unboundedly. 2. Failure quarantine. When processFn returns an error, the file's (failedAt, mtime) is recorded in Watcher.failed and subsequent ticks skip it until either the backoff elapses or its mtime changes (user replaced or touched it). Previously a permanently-broken input -- e.g. a video-only mkv that trips the "no audio streams found" path added in the multi-audio fix -- would be retried and logged every 15 s forever. Backoff is 5 minutes: comfortably longer than the 10-30 s polling interval clamp so we are not effectively retrying every tick, but short enough that an operator fixing the underlying problem by replacing the file sees it picked up promptly on the next stable scan.
Description
No description provided
150 KiB
Languages
Go
100%