pgq_coop.next_batch: do not kill master consumer
authorMarko Kreen <markokr@gmail.com>
Wed, 29 Jun 2011 07:08:59 +0000 (10:08 +0300)
committerMarko Kreen <markokr@gmail.com>
Wed, 29 Jun 2011 07:11:05 +0000 (10:11 +0300)
sql/pgq_coop/functions/pgq_coop.next_batch.sql

index 7056102bf0fca5fec2fa448f85470e974d66bc14..4e6934ad29cc1d0d40e186826767decef856629f 100644 (file)
@@ -165,6 +165,7 @@ begin
             where s.sub_queue = _queue_id
               and s.sub_id = _sub_id
               and s.sub_consumer <> _subcon_id
+              and s.sub_consumer <> _consumer_id
               and sub_active < now() - i_dead_interval
             limit 1;