Skip to content

Commit d68163c

Browse files
kardaganDavertMik
authored andcommitted
add cheduleQueueCleanup method for dynamic config of queue list to clean (#5285)
1 parent 4539f75 commit d68163c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Codeception/Module/AMQP.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class AMQP extends CodeceptionModule implements RequiresPackage
5555
'port' => '5672',
5656
'vhost' => '/',
5757
'cleanup' => true,
58-
'single_channel' => false
58+
'single_channel' => false,
59+
'queues' => []
5960
];
6061

6162
/**
@@ -276,6 +277,18 @@ public function bindQueueToExchange(
276277
);
277278
}
278279

280+
/**
281+
* Add a queue to purge list
282+
*
283+
* @param string $queue
284+
*/
285+
public function scheduleQueueCleanup($queue)
286+
{
287+
if (!in_array($queue, $this->config['queues'])) {
288+
$this->config['queues'][] = $queue;
289+
}
290+
}
291+
279292
/**
280293
* Checks if message containing text received.
281294
*

0 commit comments

Comments
 (0)