Bladeren bron

refactory command lock:wait

Guillermo Espinoza 8 jaren geleden
bovenliggende
commit
ade8225852
1 gewijzigde bestanden met toevoegingen van 2 en 3 verwijderingen
  1. 2 3
      Command/LockWaitCommand.php

+ 2 - 3
Command/LockWaitCommand.php

@@ -38,9 +38,7 @@ class LockWaitCommand extends ContainerAwareCommand
         $no_exclusive = $input->getOption('no-exclusive');
         if ($filename && $command) {
             $handle = $this->fopen($filename, $dir);
-            if ($this->flock($handle, $command, $timeout, $no_exclusive)) {
-                $output->writeln('<info>OK</info>');
-            }
+            $this->flock($handle, $command, $timeout, $no_exclusive);
         } else {
             $output->writeln('<error>Enter a valid filename and command</error>');
         }
@@ -85,6 +83,7 @@ class LockWaitCommand extends ContainerAwareCommand
             exit(1);
         });
         pcntl_alarm($timeout);
+
         $operation = LOCK_EX;
         if ($no_exclusive) {
             $operation = LOCK_SH;