REFACTOR transcription job processing to single queue#32
Conversation
…anscription jobs <--> analysis entry
All errors will be handled in the actual processing function
Jobs will now be taken one by one sequentially to prevent hogging the system resources - taking one every 5 minutes - which should be enough for transcription to be completed
| logError('Error processing transcription request', error); | ||
| } | ||
| export const getPendingTranscriptionJobScheduler = new CronJob('*/5 * * * *', async () => { | ||
| processPendingTranscriptionJobs(); |
There was a problem hiding this comment.
WARNING: Removed error handling - unhandled promise rejections may occur
Previously the call was wrapped in try-catch with error logging. Now if processPendingTranscriptionJobs throws an error, it won't be logged and may cause silent failures.
There was a problem hiding this comment.
This is a fire and forget function - every step of proccessPendingTranscriptionJobs() has its own error handling
| }; | ||
|
|
||
| export const storeNormalizedTranscriptionInDb = async (analysisEntryId, fullText, normalizedSegments) => { | ||
| export const storeNormalizedTranscriptionInDb = async (analysisEntryId, transcriptionJobId, fullText, normalizedSegments) => { |
There was a problem hiding this comment.
SUGGESTION: Unused parameter transcriptionJobId - consider removing from function signature
The function storeNormalizedTranscriptionInDb accepts transcriptionJobId but doesn't use it in the implementation. This could be removed to avoid confusion.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
|
Description
The transcription processing has been optimised to a single queue instead of the previous batching - to prevent hogging the system resources and simplify processing
Pending transcription jobs are processed every 5 minutes and each take 3-4 minutes to complete
Types of Changes
Related issue
Explanation of changes/Implementation
Screenshots (if applicable)
Pull Request Checklist
Additional Notes