BUG Enable file hash caching when running the file migration task (#8993)

This commit is contained in:
Maxime Rainville 2019-05-28 09:21:11 +12:00 committed by Ingo Schommer
parent 9bfce8c1a4
commit 7ef604807c

View File

@ -7,8 +7,9 @@ use Monolog\Logger;
use Psr\Log\LoggerInterface;
use SilverStripe\AssetAdmin\Helper\ImageThumbnailHelper;
use SilverStripe\Assets\Dev\Tasks\LegacyThumbnailMigrationHelper;
use SilverStripe\Assets\FileMigrationHelper;
use SilverStripe\Assets\Dev\Tasks\FileMigrationHelper;
use SilverStripe\Assets\Storage\AssetStore;
use SilverStripe\Assets\Storage\FileHashingService;
use SilverStripe\Control\Director;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Logging\PreformattedEchoHandler;
@ -46,6 +47,8 @@ class MigrateFileTask extends BuildTask
$args = $request->getVars();
$this->validateArgs($args);
Injector::inst()->get(FileHashingService::class)->enableCache();
$this->extend('preFileMigration');
$subtasks = !empty($args['only']) ? explode(',', $args['only']) : $this->defaultSubtasks;