mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Add support for overriding the Time and Memory Limits (#8389)
This is similar to what exists for the LDAP Import, and adds support for setting th Import and Report max execution time and memory limits Co-authored-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
0b41f9182a
commit
7557879d4a
|
@ -5,8 +5,8 @@ use Illuminate\Console\Command;
|
|||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
||||
ini_set('max_execution_time', 600); //600 seconds = 10 minutes
|
||||
ini_set('memory_limit', '500M');
|
||||
ini_set('max_execution_time', env('IMPORT_TIME_LIM', 600)); //600 seconds = 10 minutes
|
||||
ini_set('memory_limit', env('IMPORT_MEM_LIM', '500M'));
|
||||
|
||||
/**
|
||||
* Class ObjectImportCommand
|
||||
|
|
|
@ -403,7 +403,9 @@ class ReportsController extends Controller
|
|||
*/
|
||||
public function postCustom(Request $request)
|
||||
{
|
||||
ini_set('max_execution_time', 12000);
|
||||
|
||||
|
||||
ini_set('max_execution_time', env('REPORT_TIME_LIM', 12000)); //12000 seconds = 200 minutes
|
||||
$this->authorize('reports.view');
|
||||
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ class ItemImportRequest extends FormRequest
|
|||
|
||||
public function import(Import $import)
|
||||
{
|
||||
ini_set('max_execution_time', 600); //600 seconds = 10 minutes
|
||||
ini_set('memory_limit', '500M');
|
||||
ini_set('max_execution_time', env('IMPORT_TIME_LIM', 600)); //600 seconds = 10 minutes
|
||||
ini_set('memory_limit', env('IMPORT_MEM_LIM', '500M'));
|
||||
$filename = config('app.private_uploads') . '/imports/' . $import->file_path;
|
||||
$import->import_type = $this->input('import-type');
|
||||
$class = title_case($import->import_type);
|
||||
|
|
Loading…
Reference in a new issue