Skip to content
Snippets Groups Projects
Unverified Commit e1509908 authored by Sebastian Castro's avatar Sebastian Castro
Browse files

Fixs running command synschronously

parent eaae2325
No related branches found
No related tags found
No related merge requests found
......@@ -59,13 +59,14 @@ class AsyncService
$saasHelper = new SaasHelper();
$dbname = $saasHelper->getCurrentProjectCode();
}
$commandline = $this->phpPath . ' ' . $this->consolePath . ' ' . $commandName;
foreach ($arguments as $key => $arg) {
$commandline .= ' ' . $arg;
}
$commandline .= ' ' . $dbname;
$commandline .= ' > /tmp/command.log 2>/tmp/command.log &';
$commandline .= ' > /tmp/command.log 2>/tmp/command.log';
if (!$this->runSynchronously) $commandline .= ' &';
return $this->runProcess($commandline);
}
......@@ -97,14 +98,7 @@ class AsyncService
{
$process = new Process($commandline);
$process->start();
if ($this->runSynchronously)
{
while ($process->isRunning()) {
// waiting for process to finish
}
return $process->getOutput();
}
if ($this->runSynchronously) $process->wait();
return $process->getPid();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment