setPidFile() public method

Set the worker pid file
public setPidFile ( string $pidFile )
$pidFile string Filename to store pid in
Example #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $queue = $this->getConfig('queue');
     $blocking = filter_var($this->getConfig('blocking'), FILTER_VALIDATE_BOOLEAN);
     // Create worker instance
     $worker = new Resque\Worker($queue, $blocking);
     $worker->setLogger($this->logger);
     if ($pidFile = $this->getConfig('pid')) {
         $worker->setPidFile($pidFile);
     }
     if ($interval = $this->getConfig('interval')) {
         $worker->setInterval($interval);
     }
     if ($timeout = $this->getConfig('timeout')) {
         $worker->setTimeout($timeout);
     }
     // The memory limit is the amount of memory we will allow the script to occupy
     // before killing it and letting a process manager restart it for us, which
     // is to protect us against any memory leaks that will be in the scripts.
     if ($memory = $this->getConfig('memory')) {
         $worker->setMemoryLimit($memory);
     }
     $worker->work();
 }