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.
This commit is contained in:
Magnus Hagander
2013-09-10 13:54:21 +02:00
parent 21f5915568
commit d1535febb9
2 changed files with 2 additions and 1 deletions

View File

@ -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', {