Wrap PdfHandler metadata unserialization in PoolCounter

Change-Id: I0ce60a044c64a59bd44eef8cc5bd520d0b46230e
This commit is contained in:
Chad Horohoe 2015-04-24 13:17:12 -07:00
parent 2594ae397a
commit 5d286c85c0

View file

@ -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;
}