Skip to content

Commit

Permalink
Make the varnish queue id configurable
Browse files Browse the repository at this point in the history
This is required if the queue is dropped and recreated in pgq as it
gets a new id, which needs to be used when viewing the current status
of the queue in the admin interface.
  • Loading branch information
mhagander committed Sep 10, 2013
1 parent 21f5915 commit d1535fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pgweb/core/views.py
Expand Up @@ -206,7 +206,7 @@ def admin_purge(request):

# Fetch list of latest purges
curs = connection.cursor()
curs.execute("SELECT ev_time, ev_type, ev_data FROM pgq.event_1 WHERE ev_type IN ('P', 'X') ORDER BY ev_time DESC LIMIT 20")
curs.execute("SELECT ev_time, ev_type, ev_data FROM pgq.event_%s WHERE ev_type IN ('P', 'X') ORDER BY ev_time DESC LIMIT 20" % settings.VARNISH_QUEUE_ID)
latest = [{'t': r[0], 'ty': r[1], 'u': r[2]} for r in curs.fetchall()]

return render_to_response('core/admin_purge.html', {
Expand Down
1 change: 1 addition & 0 deletions pgweb/settings.py
Expand Up @@ -156,6 +156,7 @@
FTP_MASTERS=() # A tuple containing the *IP addresses* of all machines
# trusted to upload ftp structure data
VARNISH_PURGERS=() # Extra servers that can do varnish purges through our queue
VARNISH_QUEUE_ID=1 # pgq queue id used for varnish purging
ARCHIVES_SEARCH_SERVER="archives.postgresql.org" # Where to post REST request for archives search

# Load local settings overrides
Expand Down

0 comments on commit d1535fe

Please sign in to comment.