$jobs[] = $this->_jobDownloadFluidbook($fbid, $version, $basePath . $this->dirs[$fbid], $fbOptions, true);
}
- //$this->_waitJobs($jobs);
+ $this->_waitJobs($jobs);
if (in_array('en', $this->langs)) {
$default = 'en';
{
$nbjobs = count($jobs);
$done = 0;
+ $ids = [];
+ $idstodo=[];
foreach ($jobs as $job) {
if ($job->isDone()) {
+ $ids[] = $job->getBookId();
$done++;
+ } else {
+ $idstodo[] = $job->getBookId();
}
}
if (rand(1, 10) == 5) {
- echo $done . '/' . $nbjobs . "\n";
+ echo $done . ' (' . implode(',', $ids) . ')/' . $nbjobs . " (" . implode(',', $idstodo) . ")\n";
}
return $done === $nbjobs;
}
try {
$packager = Packager::package($this->getBookId(), $this->getVersion(), false, true, $this->getOptions());
$packager->handle();
- (new Rsync($packager->getFinalPath(),$this->getDestination()))->execute();
+ (new Rsync($packager->getFinalPath(), $this->getDestination()))->execute();
$this->setResult(true);
} catch (\Exception $e) {
$this->setException($e);
+ } finally {
+ $this->setDone(true);
}
- $this->setDone(true);
}
/**