mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
Merge pull request #2957 from h3xx/fix-memory-limit
Fix global memory limit set in constructor
This commit is contained in:
commit
a53692f6bf
1 changed files with 3 additions and 1 deletions
|
@ -65,7 +65,6 @@ class ImportCities extends Command
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
ini_set('memory_limit', '256M');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,6 +74,8 @@ class ImportCities extends Command
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
$old_memory_limit = ini_get('memory_limit');
|
||||||
|
ini_set('memory_limit', '256M');
|
||||||
$path = storage_path('app/cities.json');
|
$path = storage_path('app/cities.json');
|
||||||
|
|
||||||
if(hash_file('sha512', $path) !== self::CHECKSUM) {
|
if(hash_file('sha512', $path) !== self::CHECKSUM) {
|
||||||
|
@ -136,6 +137,7 @@ class ImportCities extends Command
|
||||||
$this->line('');
|
$this->line('');
|
||||||
$this->info('Successfully imported ' . $cityCount . ' entries!');
|
$this->info('Successfully imported ' . $cityCount . ' entries!');
|
||||||
$this->line('');
|
$this->line('');
|
||||||
|
ini_set('memory_limit', $old_memory_limit);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue