$this->config = new Data(array_merge($this->fluidbookSettings->getRawData()['settings'], $this->themeSettings->getRawData()));
- $this->config->pages = count($this->getFluidbook()->composition);
+ $this->config->pages = count($this->getFluidbook()->getComposition());
$this->config->bookmarkDisablePages = ArrayUtil::parseRange($this->config->bookmarkDisablePages);
$this->config->rasterizePages = ArrayUtil::parseRange($this->config->rasterizePages);
$this->config->vectorPages = array_diff(ArrayUtil::parseRange($this->config->vectorPages), $this->config->rasterizePages);
{
$this->lock = \Illuminate\Support\Facades\Cache::lock('fluidbook_compile_' . $this->book_id, 1800);
+ $this->log('Check lock');
+
if ($this->lock->block(300)) {
try {
if (!$this->compositionCached()) {
protected static $_farmServers = [
['name' => 'amadeus', 'host' => 'amadeus.cubedesigners.com', 'weight' => 1, 'region' => Region::EUROPE, 'local' => false],
- ['name' => 'benhur', 'host' => 'amadeus.cubedesigners.com', 'weight' => 8, 'region' => Region::EUROPE, 'local' => false],
+ ['name' => 'benhur', 'host' => 'benhur.cubedesigners.com', 'weight' => 8, 'region' => Region::EUROPE, 'local' => false],
['name' => 'cloudatlas', 'host' => 'cloudatlas.cubedesigners.com', 'weight' => 2, 'region' => Region::EUROPE, 'local' => false],
['name' => 'dobermann', 'host' => 'dobermann.cubedesigners.com', 'weight' => 6, 'region' => Region::EUROPE, 'local' => false],
['name' => 'elephantman', 'host' => 'paris.cubedesigners.com', 'weight' => 2, 'region' => Region::EUROPE, 'local' => false],
protected static function _getFile($params, $attempts = 3, $checkOutput = true, $preferLocal = false)
{
$start = microtime(true);
+// if ($params['operation'] === 'extractpdfarea') {
+// static::$_forceServer = 'amadeus';
+// }
$farmer = self::pickOneServer($preferLocal, $params);
$params['toolbox'] = '1';
}
$lock = 'pdfarea_' . hash('sha256', $file . '_' . $page . '_' . json_encode($rect) . '_' . json_encode($options));
- $res = static::lock($file, $lock, function () use ($file, $page, $rect, $to, $options, $cache) {
+ $res = static::lock($file, $lock, function () use ($file, $page, $rect, $to, $options, $cache, $final) {
return self::_getFile(
['operation' => 'extractpdfarea',
'pdf' => $file,
'out' => $cache,
'page' => $page,
'area' => json_encode($rect),
- 'options' => json_encode($options)], 0, true, true);
+ 'options' => json_encode($options)], 0, $final, true);
});
return $res;
}