Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
30 | protected function execute(InputInterface $input, OutputInterface $output) |
||
31 | { |
||
32 | $pidFile = $this->getContainer()->get('kernel')->getCacheDir() . '/resque_scheduledworker.pid'; |
||
33 | |||
34 | if (!file_exists($pidFile)) { |
||
35 | $output->writeln('No PID file found'); |
||
36 | |||
37 | return -1; |
||
38 | } |
||
39 | |||
40 | $pid = file_get_contents($pidFile); |
||
41 | |||
42 | $output->writeln('Killing process ' . $pid); |
||
43 | |||
44 | \posix_kill($pid, SIGKILL); |
||
45 | |||
46 | unlink($pidFile); |
||
47 | |||
48 | return 0; |
||
49 | } |
||
50 | } |
||
51 |