Skip to content

Commit

Permalink
Merge pull request symfony#101 from tgabi333/master
Browse files Browse the repository at this point in the history
bugfix: 100% proc usage
  • Loading branch information
stof committed Sep 13, 2012
2 parents de2be21 + 77e701d commit ca999f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Command/DumpCommand.php
Expand Up @@ -95,6 +95,9 @@ private function watch(InputInterface $input, OutputInterface $output)
$previously = array();
} else {
$previously = unserialize(file_get_contents($cache));
if (!is_array($previously)) {
$previously = array();
}
}

$error = '';
Expand All @@ -112,14 +115,13 @@ private function watch(InputInterface $input, OutputInterface $output)

file_put_contents($cache, serialize($previously));
$error = '';

sleep($input->getOption('period'));
} catch (\Exception $e) {
if ($error != $msg = $e->getMessage()) {
$output->writeln('<error>[error]</error> '.$msg);
$error = $msg;
}
}
sleep($input->getOption('period'));
}
}

Expand Down

0 comments on commit ca999f5

Please sign in to comment.