feat: separate queue jobs from consumers for configurable processing#1968
Open
feat: separate queue jobs from consumers for configurable processing#1968
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR separates queue jobs from their consumers to enable configurable processing through environment variables. The refactoring allows for disabling queue consumers while maintaining the ability to enqueue jobs.
- Extracted job interfaces and queue management logic into separate "job" classes
- Created a utility function to conditionally provide queue processors based on environment configuration
- Refactored all queue-related services to depend on job classes instead of processors directly
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk/src/context/app/useConnection.tsx | Updated comment to reflect correct timeout duration |
| apps/nestjs-backend/src/utils/queue.ts | Added utility function for conditional queue processor provisioning |
| apps/nestjs-backend/src/share-db/share-db.service.ts | Removed unnecessary transaction wrapper for table metadata updates |
| Multiple processor files | Refactored to separate job management from processing logic |
| Multiple job files | New files containing queue interfaces and job management logic |
| Multiple module files | Updated to use conditional processor providers and export job classes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| useConnectionAutoManage(socket, updateShareDb, { | ||
| // 10 minutes, it will be closed when the user is leave the page for 1 hour | ||
| // 1 hour, it will be closed when the user is leave the page for 1 hour |
There was a problem hiding this comment.
Corrected grammar from 'user is leave' to 'user leaves'.
Suggested change
| // 1 hour, it will be closed when the user is leave the page for 1 hour | |
| // 1 hour, it will be closed when the user leaves the page for 1 hour |
| }, | ||
| }); | ||
| await this.attachmentsCropQueueProcessor.queue.add('attachment_crop_image', { | ||
| await this.attachmentsCropJob.addAttachmentCropImage({ |
There was a problem hiding this comment.
The method call should pass the data object directly to maintain consistency with the queue.add pattern used elsewhere in the codebase.
c7ef181 to
4e6adcd
Compare
3f7a8ad to
c9603ab
Compare
caoxing9
approved these changes
Oct 13, 2025
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.
No description provided.