mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Moved time limit increases from individual job
Should apply to all file migration subtasks, not just the first one (see silverstripe/assets)
This commit is contained in:
parent
30496144b9
commit
b21e5d9e57
@ -12,6 +12,7 @@ use SilverStripe\Assets\Dev\Tasks\FileMigrationHelper;
|
||||
use SilverStripe\Assets\Storage\AssetStore;
|
||||
use SilverStripe\Assets\Storage\FileHashingService;
|
||||
use SilverStripe\Control\Director;
|
||||
use SilverStripe\Core\Environment;
|
||||
use SilverStripe\Core\Injector\Injector;
|
||||
use SilverStripe\Logging\PreformattedEchoHandler;
|
||||
use SilverStripe\Dev\BuildTask;
|
||||
@ -51,6 +52,10 @@ class MigrateFileTask extends BuildTask
|
||||
|
||||
Injector::inst()->get(FileHashingService::class)->enableCache();
|
||||
|
||||
// Set max time and memory limit
|
||||
Environment::increaseTimeLimitTo();
|
||||
Environment::increaseMemoryLimitTo();
|
||||
|
||||
$this->extend('preFileMigration');
|
||||
|
||||
$this->logger->warn(
|
||||
@ -248,14 +253,14 @@ TXT;
|
||||
// for example when this task is run as part of a queuedjob
|
||||
$logger = Injector::inst()->get(LoggerInterface::class)->withName('log');
|
||||
|
||||
$formatter = new ColoredLineFormatter();
|
||||
$formatter->ignoreEmptyContextAndExtra();
|
||||
$formatter = new ColoredLineFormatter();
|
||||
$formatter->ignoreEmptyContextAndExtra();
|
||||
|
||||
$errorHandler = new StreamHandler('php://stderr', Logger::ERROR);
|
||||
$errorHandler->setFormatter($formatter);
|
||||
$errorHandler->setFormatter($formatter);
|
||||
|
||||
$standardHandler = new StreamHandler('php://stdout');
|
||||
$standardHandler->setFormatter($formatter);
|
||||
$standardHandler = new StreamHandler('php://stdout');
|
||||
$standardHandler->setFormatter($formatter);
|
||||
|
||||
// Avoid double logging of errors
|
||||
$standardFilterHandler = new FilterHandler(
|
||||
@ -265,7 +270,7 @@ TXT;
|
||||
);
|
||||
|
||||
$logger->pushHandler($standardFilterHandler);
|
||||
$logger->pushHandler($errorHandler);
|
||||
$logger->pushHandler($errorHandler);
|
||||
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user