mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PdfHandler
synced 2024-11-27 17:50:47 +00:00
Wrap PdfHandler metadata unserialization in PoolCounter
Change-Id: I0ce60a044c64a59bd44eef8cc5bd520d0b46230e
This commit is contained in:
parent
2594ae397a
commit
5d286c85c0
|
@ -271,11 +271,14 @@ class PdfHandler extends ImageHandler {
|
|||
return false;
|
||||
}
|
||||
|
||||
wfProfileIn( __METHOD__ );
|
||||
wfSuppressWarnings();
|
||||
$image->pdfMetaArray = unserialize( $metadata );
|
||||
wfRestoreWarnings();
|
||||
wfProfileOut( __METHOD__ );
|
||||
$work = new PoolCounterWorkViaCallback( 'PdfHandler-unserialize-metadata', $image->getName(), array(
|
||||
'doWork' => function() use ( $image, $metadata ) {
|
||||
wfSuppressWarnings();
|
||||
$image->pdfMetaArray = unserialize( $metadata );
|
||||
wfRestoreWarnings();
|
||||
},
|
||||
) );
|
||||
$work->execute();
|
||||
|
||||
return $image->pdfMetaArray;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue