Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
40 | public function fire() |
||
41 | { |
||
42 | $queue = ($this->argument('queue')) ? |
||
43 | $this->argument('queue') : |
||
44 | config('queue.connections.beanstalkd.queue'); |
||
45 | |||
46 | $this->info(sprintf('Clearing queue: %s', $queue)); |
||
47 | |||
48 | $pheanstalk = Queue::getPheanstalk(); |
||
49 | $pheanstalk->useTube($queue); |
||
50 | $pheanstalk->watch($queue); |
||
51 | |||
52 | while ($job = $pheanstalk->reserve(0)) { |
||
53 | $pheanstalk->delete($job); |
||
54 | } |
||
55 | |||
56 | $this->info('...cleared.'); |
||
57 | } |
||
58 | } |
||
59 |