mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Enable file hash caching when running the file migration task (#8993)
This commit is contained in:
parent
9bfce8c1a4
commit
7ef604807c
@ -7,8 +7,9 @@ use Monolog\Logger;
|
|||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use SilverStripe\AssetAdmin\Helper\ImageThumbnailHelper;
|
use SilverStripe\AssetAdmin\Helper\ImageThumbnailHelper;
|
||||||
use SilverStripe\Assets\Dev\Tasks\LegacyThumbnailMigrationHelper;
|
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\AssetStore;
|
||||||
|
use SilverStripe\Assets\Storage\FileHashingService;
|
||||||
use SilverStripe\Control\Director;
|
use SilverStripe\Control\Director;
|
||||||
use SilverStripe\Core\Injector\Injector;
|
use SilverStripe\Core\Injector\Injector;
|
||||||
use SilverStripe\Logging\PreformattedEchoHandler;
|
use SilverStripe\Logging\PreformattedEchoHandler;
|
||||||
@ -46,6 +47,8 @@ class MigrateFileTask extends BuildTask
|
|||||||
$args = $request->getVars();
|
$args = $request->getVars();
|
||||||
$this->validateArgs($args);
|
$this->validateArgs($args);
|
||||||
|
|
||||||
|
Injector::inst()->get(FileHashingService::class)->enableCache();
|
||||||
|
|
||||||
$this->extend('preFileMigration');
|
$this->extend('preFileMigration');
|
||||||
|
|
||||||
$subtasks = !empty($args['only']) ? explode(',', $args['only']) : $this->defaultSubtasks;
|
$subtasks = !empty($args['only']) ? explode(',', $args['only']) : $this->defaultSubtasks;
|
||||||
|
Loading…
Reference in New Issue
Block a user