fix: [#934] Modify queue database connection when installing db driver#1425
Merged
fix: [#934] Modify queue database connection when installing db driver#1425
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## master #1425 +/- ## ========================================== + Coverage 67.98% 68.20% +0.22% ========================================== Files 354 357 +3 Lines 27521 27648 +127 ========================================== + Hits 18709 18857 +148 + Misses 7963 7940 -23 - Partials 849 851 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
queue.connections.database.connectionandqueue.failed.databasefromDB_CONNECTION, removing the hardcodedpostgresbehavior.DB_CONNECTION=so driver installers can persist the selected connection in.env.modify.Env(file, key, value)to rewrite existing.envkeys (including duplicates) or append missing keys, while returningos.ErrNotExistwhen the file is absent.Closes #934
Why
Installing a non-PostgreSQL driver could still leave queue database settings pinned to
postgres, causing workers and failed-job logging to use the wrong database connection. The setup stubs now consistently defer toDB_CONNECTION, and the generated.envtemplate always includes that key for installer updates.The new
modify.Envhelper centralizes.envrewrites in setup flows so repeated runs replace stale values instead of drifting. It also fails fast when.envis missing, giving callers a concrete setup error to handle.