mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
Merge pull request #3372 from alchemy-fr/PHRAS-2943-set-exiftool-timeout
PHRAS-2943 #comment merge 4.1 Set exiftool timeout, default is 60 secondes
This commit is contained in:
@@ -103,6 +103,7 @@ main:
|
||||
mp4box_timeout: 60
|
||||
swftools_timeout: 60
|
||||
unoconv_timeout: 60
|
||||
exiftool_timeout: 60
|
||||
storage:
|
||||
subdefs: null
|
||||
cache: null
|
||||
|
@@ -9,6 +9,8 @@ use MediaVorus\MediaVorusServiceProvider;
|
||||
use MP4Box\MP4BoxServiceProvider;
|
||||
use Neutron\Silex\Provider\ImagineServiceProvider;
|
||||
use PHPExiftool\PHPExiftoolServiceProvider;
|
||||
use PHPExiftool\Reader;
|
||||
use PHPExiftool\Writer;
|
||||
use Silex\Application;
|
||||
use Silex\ServiceProviderInterface;
|
||||
|
||||
@@ -48,6 +50,21 @@ class MediaUtilitiesMetaServiceProvider implements ServiceProviderInterface
|
||||
|
||||
public function boot(Application $app)
|
||||
{
|
||||
// no-op
|
||||
if(isset($app['exiftool.reader']) && isset($app['conf'])) {
|
||||
try {
|
||||
$timeout = $app['conf']->get(['main', 'binaries', 'exiftool_timeout'], 60);
|
||||
|
||||
/** @var Reader $exiftoolReader */
|
||||
$exiftoolReader = $app['exiftool.reader'];
|
||||
$exiftoolReader->setTimeout($timeout);
|
||||
|
||||
/** @var Writer $exiftoolWriter */
|
||||
$exiftoolWriter = $app['exiftool.writer'];
|
||||
$exiftoolWriter->setTimeout($timeout);
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
// no-nop
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -103,6 +103,7 @@ main:
|
||||
mp4box_timeout: 60
|
||||
swftools_timeout: 60
|
||||
unoconv_timeout: 60
|
||||
exiftool_timeout: 60
|
||||
storage:
|
||||
subdefs: null
|
||||
cache: null
|
||||
|
Reference in New Issue
Block a user