Fix: Enable RQ_QUEUES configuration via environment variables (#8455) #8456
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.
Reason for change
Problem: RQ_QUEUES was hardcoded to an empty dictionary
{}
inlabel_studio/core/settings/label_studio.py
, preventing Redis Queueconfiguration via environment variables and breaking background job processing.
Solution: Changed
RQ_QUEUES = {}
toRQ_QUEUES = json.loads(get_env("RQ_QUEUES", "{}"))
to enable environment variableconfiguration while maintaining backward compatibility.
Rollout strategy
This change uses an existing environment variable pattern (
get_env
) and maintains backward compatibility with empty dict default. Nofeature flags required - the change is safe to deploy immediately.
Testing
Manual verification:
{}
whenRQ_QUEUES
environment variable is not setRQ_QUEUES
environment variableUnit tests: Not required for this change as it's a simple Django settings configuration modification. Existing RQ functionality tests
will verify the configuration works correctly.
Risks
Low risk:
get_env
pattern consistent with other settings in the same fileReviewer notes
get_env
usage)General notes
This fix enables proper Redis Queue configuration for production deployments where Redis might be running on different hosts/ports or
require authentication, while maintaining the current behavior for existing installations.
Fixes #8455