protected $bookId = null;\r
public $reload = false;\r
\r
- protected $nb_threads = 4;\r
+ protected $nb_threads = 8;\r
protected $threads;\r
\r
public function __construct($guid)\r
\r
protected function initThreads()\r
{\r
- if (!cubeThread::available()) {\r
+ if (!cubeThread::available() || $this->nb_threads <= 1) {\r
return;\r
}\r
$this->threads = array();\r
\r
$this->setProgress(($this->processedPages / $this->totalPages) * 100);\r
\r
- if (cubeThread::available()) {\r
+ if (cubeThread::available() && $this->nb_threads > 1) {\r
$t = $this->threads[$i % $this->nb_threads];\r
while ($t->isAlive()) {\r
usleep(100000);\r
}\r
$this->setProgress(($this->processedPages / $this->totalPages) * 100);\r
\r
- $doc = $dao->updateFromObject($doc);\r
+ $this->currentDoc = $dao->updateFromObject($this->currentDoc);\r
if (!$this->reload) {\r
// On n'ajoute les fichiers à la fin du fluidbook que si l'on\r
// n'est pas en train de recharger le fluidbook\r
- $daoBook->appendDocument($this->bookId, $doc->document_id);\r
+ $daoBook->appendDocument($this->bookId, $this->currentDoc->document_id);\r
}\r
$this->processedDoc++;\r
}\r