Batch#
Directory scan and the batch loop (error isolation, circuit breaker, summary).
- exception remote_compression.batch.BatchAborted[source]#
Too many consecutive failures: the batch stops instead of burning CPU.
- class remote_compression.batch.BatchSummary(done: int = 0, conform: int = 0, tracked: int = 0, failed: int = 0, not_profitable: int = 0, dry_run: int = 0, bytes_before: int = 0, bytes_after: int = 0, keep_files_seen: int = 0)[source]#
Counters of a batch run.
- done, conform, tracked, failed, not_profitable, dry_run
Files per outcome (
tracked= skipped through the failure log).- Type:
- bytes_before, bytes_after
Cumulated sizes of successfully compressed files.
- Type:
- bump(result)[source]#
Account for one
FileResult.
- remote_compression.batch.LEGACY_KEEP = '.keep'#
Legacy per-directory tracking files from rcomp < 0.2 (dill format, unused).
- remote_compression.batch.MAX_CONSECUTIVE_FAILURES = 5#
Consecutive failures beyond which the batch aborts (something is systemic).
- remote_compression.batch.run_batch(target, settings, dry_run=False, retry_failed=False, no_progress=False, tracker=None, host=None)[source]#
Compress every relevant video under target.
- Parameters:
settings (
Settings) – Resolved settings.dry_run (
bool) – Show the work without doing it: no ffmpeg, no SSH connection, no write.retry_failed (
bool) – Ignore the failure log and retry those files.no_progress (
bool) – Disable the tqdm bars.tracker (
Tracker, optional) – Injected failure log (defaults to the user-wide one).host (optional) – Injected execution host (defaults to
open_host()on the settings). Entered as a context manager either way.
- Returns:
Also logged at the end, including on interruption.
- Return type:
- Raises:
BatchAborted – After
MAX_CONSECUTIVE_FAILURESconsecutive failures.