Skip to content

REFACTOR transcription job processing to single queue#32

Merged
SergioNR merged 7 commits intonextfrom
improve-transcription-job-logic
Jan 11, 2026
Merged

REFACTOR transcription job processing to single queue#32
SergioNR merged 7 commits intonextfrom
improve-transcription-job-logic

Conversation

@SergioNR
Copy link
Copy Markdown
Member

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update (if applicable)
  • Refactor (non-breaking change that improves the code structure)

Related issue

Explanation of changes/Implementation

Screenshots (if applicable)

Pull Request Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Additional Notes

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();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fire and forget function - every step of proccessPendingTranscriptionJobs() has its own error handling

Comment thread server/models/transcriptionModel.js Outdated
};

export const storeNormalizedTranscriptionInDb = async (analysisEntryId, fullText, normalizedSegments) => {
export const storeNormalizedTranscriptionInDb = async (analysisEntryId, transcriptionJobId, fullText, normalizedSegments) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented Jan 11, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files)
  • .eslintrc.cjs
  • prisma/schema.prisma
  • server/controllers/transcriptionController.js
  • server/cron/getPendingTranscriptionJobScheduler.js
  • server/integrations/s3-client/s3.js
  • server/models/transcriptionModel.js

@SergioNR SergioNR merged commit 52d4fbc into next Jan 11, 2026
@SergioNR SergioNR deleted the improve-transcription-job-logic branch January 11, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant