Opened on 09/17/2014 at 06:29:19 PM
Closed on 09/18/2014 at 09:09:49 AM
#1389 closed change (fixed)
Discourse: Don't run queries for site settings if the correct value is already set
Reported by: | trev | Assignee: | trev |
---|---|---|---|
Priority: | P3 | Milestone: | |
Module: | Infrastructure | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Platform: | Unknown | |
Ready: | yes | Confidential: | no |
Tester: | Verified working: | no | |
Review URL(s): |
Description
Background
The discourse::sitesettings class is currently implemented in such a way that it will always run the PSQL query, no matter whether it would have any effect. We implemented it this way because we couldn't figure out how to use the unless class of the postgresql_psql type. This produces lots of unnecessary output, and it also triggers unnecessary Discourse restarts.
What to change
Turns out, unless doesn't care about the value returned. All it cares it the number of rows - an empty result means that the query is executed, a non-zero number of rows means "nothing to do."
Attachments (0)
Change History (2)
Note: See
TracTickets for help on using
tickets.
Fixed: https://hg.adblockplus.org/infrastructure/rev/675a92178a28