\r
$this->updateCountPages();\r
$this->currentDoc = $dao->updateFromObject($this->currentDoc);\r
+ $doc_serialized = serialize($this->currentDoc);\r
\r
foreach($docPages as $i => $page) {\r
$this->currentDocPage = $i + 1;\r
while ($t->isAlive()) {\r
usleep(100000);\r
}\r
- $t->setRunnable(array($this->currentDoc, 'processOnePage'));\r
- $t->start($page, true);\r
+ $t->setRunnable(array('wsConversionSession', 'processPage'));\r
+ $t->start($doc_serialized, $page);\r
} else {\r
$this->currentDoc->processOnePage($page, true);\r
}\r
$this->processedPages++;\r
}\r
\r
- foreach($this->threads as $t) {\r
- while ($t->isAlive()) {\r
- usleep(100000);\r
+ if (cubeThread::available() && $this->nb_threads > 1) {\r
+ foreach($this->threads as $t) {\r
+ while ($t->isAlive()) {\r
+ usleep(100000);\r
+ }\r
}\r
}\r
- $this->setProgress(($this->processedPages / $this->totalPages) * 100);\r
\r
- $this->currentDoc = $dao->updateFromObject($this->currentDoc);\r
+ $this->currentDoc = unserialize($doc_serialized);\r
+\r
+ $core->reloadDBConnection();\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, $this->currentDoc->document_id);\r
}\r
$this->processedDoc++;\r
+\r
+ ob_flush();\r
}\r
\r
+ sleep(1);\r
+\r
$this->complete = true;\r
$this->processing = false;\r
$this->setProgress(100);\r
}\r
\r
+ public static function processPage($doc_serialized, $page)\r
+ {\r
+ $doc = unserialize($doc_serialized);\r
+ $doc->processOnePage($page, true);\r
+ }\r
+\r
public function updateCountPages()\r
{\r
$this->totalPages = 0;\r