[openstreetmap/openstreetmap-website] WIP: Convert database config to support reading from replicas (#2563)
Andy Allan
notifications at github.com
Wed Apr 8 12:55:25 UTC 2020
> Here's one candidate: reading a message (via GET /message/id) updates the message_read flag:
That's a perfect example! Thanks for finding it. So we have two things we need to do:
* Most importantly, figure out how to run the tests so that they use read-only connections when they are using the `reading` connection. If we don't do this, then there's a risk that the tests will pass and stuff will break in production.
* Figure out what to do on a case-by-case basis. I suspect if we just find a few methods like this (where the write to the database is a side effect of a larger purpose that's read only) then we can wrap the line or two in a block that uses the `writing` connection.
If anyone has any suggestions on the first topic, I'm all ears. I've marked this WIP in the meantime.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2563#issuecomment-610942481
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200408/fcccdc8f/attachment.htm>
More information about the rails-dev
mailing list