Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues when using multiple databases with a database router #440

Merged
merged 2 commits into from May 27, 2020

Conversation

maerteijn
Copy link
Contributor

@maerteijn maerteijn commented May 14, 2020

This PR fixes some issues when using Django with multiple databases and a database router, and a dedicated connection for the ORM Broker:

  • get_connection of the ORM Broker did not check for the used ORM database connection
  • The atomic transaction in the scheduler always started a transaction on the default database, not checking where the Scheduler object "lives".

See also #434 with a reproducable repository and a confirmation that these patches work.

The tests pass (locally), so let me know if anything more is required for this PR to be merged.

@codecov-io
Copy link

codecov-io commented May 14, 2020

Codecov Report

Merging #440 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #440   +/-   ##
=======================================
  Coverage   90.75%   90.75%           
=======================================
  Files          43       43           
  Lines        2930     2930           
=======================================
  Hits         2659     2659           
  Misses        271      271           
Impacted Files Coverage Δ
django_q/brokers/orm.py 97.95% <100.00%> (ø)
django_q/cluster.py 91.99% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 108050b...f0546bc. Read the comment docs.

@maerteijn maerteijn changed the title Fix issues when using multiple database with a database router Fix issues when using multiple databases with a database router May 15, 2020
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.

None yet

3 participants