Merged
Conversation
…nt variable if needed
…ranscode the same file, also remove the general scan lock before starting a transcode process
… transcoding flow
… a container restart for example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major refactor of the transcoding job queue to use a persistent database-backed queue (
TranscodeJobmodel) instead of an in-memory Python list. This enables robust, multi-worker-safe transcoding job management, prevents job loss on process restarts, and allows for better status reporting and cancellation. Additionally, it introduces process locking for transcoding, improves worker startup and cleanup logic, and makes several operational improvements to concurrency and resource management.Transcoding Queue Refactor and Improvements:
TranscodeJobdatabase model to persistently track transcoding jobs, their status (pending,running,complete,failed), and timestamps, replacing the previous in-memory queue. [1] [2]api/transcoding.pyto use the database for queueing, deduplication, claiming, and status reporting, with robust recovery of stale jobs and atomic job claiming for multi-worker safety. [1] [2] [3] [4]Process Locking and Worker Coordination:
util.pynow support custom filenames. [1] [2] [3] [4]Operational and Configuration Improvements:
ENABLE_TRANSCODINGto the.env.devfile for easier local configuration.Bulk Import and Lock Handling:
These changes make transcoding more reliable, observable, and robust in multi-worker/container environments, and lay the groundwork for more advanced job management and status features.