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):



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)

comment:1 Changed on 09/17/2014 at 06:35:02 PM by trev

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed on 09/18/2014 at 09:09:49 AM by trev

  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from trev.
Note: See TracTickets for help on using tickets.