(self, params)
Alter queue parameters, accepts * for all queues
Alter queue parameters, accepts * for all queues
Alter queue parameters accepts * for all queues
def cmd_alter_queue(self, params):
        """Alter queue parameters, accepts * for all queues"""
        queue = params.get('queue')
        curs = self.db.cursor()
        if queue == '*':
            # operate on list of queues
            q = "select queue_name from pgq.get_queue_info()"
            curs.execute(q)
            qlist = [ r[0] for r in curs.fetchall() ]
        else:
            # just single queue specified
            qlist = [ queue ]

        for qname in qlist:
            params['queue'] = qname

            # loop through the parameters, passing any unrecognized
            # key down pgq.set_queue_config
            for k in params:
                if k in ('queue', 'cmd', 'cmd2'):
                    continue

                q = "select * from pgq.set_queue_config" \
                    "(%%(queue)s, '%s', %%(%s)s)" % (k, k)

                curs.execute(q, params)
        print "ALTER"
def cmd_alter_queue ( self , params ) : queue = params . get ( 'queue' ) curs = self . db . cursor ( ) if queue == '*' : # operate on list of queues q = "select queue_name from pgq.get_queue_info()" curs . execute ( q ) qlist = [ r [ 0 ] for r in curs . fetchall ( ) ] else : # just single queue specified qlist = [ queue ] for qname in qlist : params [ 'queue' ] = qname # loop through the parameters, passing any unrecognized # key down pgq.set_queue_config for k in params : if k in ( 'queue' , 'cmd' , 'cmd2' ) : continue q = "select * from pgq.set_queue_config" "(%%(queue)s, '%s', %%(%s)s)" % ( k , k ) curs . execute ( q , params ) print "ALTER"