Permalink
Browse files

Make the varnish queue id configurable

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...
1 parent 21f5915 commit d1535febb970af189ead99ff4d1705a30b3a365b @mhagander mhagander committed Sep 10, 2013
Showing with 2 additions and 1 deletion.
  1. +1 −1 pgweb/core/views.py
  2. +1 −0 pgweb/settings.py
View
2 pgweb/core/views.py
@@ -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', {
View
1 pgweb/settings.py
@@ -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

0 comments on commit d1535fe

Please sign in to comment.