Add a memory limit setting

This commit is contained in:
Phan An 2017-08-21 21:45:01 +01:00
parent 48c67fff5e
commit c95d74d487
3 changed files with 12 additions and 0 deletions

View file

@ -37,6 +37,12 @@ APP_URL=http://localhost
APP_MAX_SCAN_TIME=600
# The memory limit, in MB, used by the scanning process.
# For example, if you want to set a memory limit of 2048MB, enter "2048" (without
# quotes) here.
MEMORY_LIMIT=
# The streaming method.
# Can be either 'php' (default), 'x-sendfile', or 'x-accel-redirect'
# See https://github.com/phanan/koel/wiki#streaming-music for more information.

View file

@ -57,6 +57,10 @@ class Media
set_time_limit(config('koel.sync.timeout'));
}
if (config('koel.memory_limit')) {
ini_set('memory_limit', config('koel.memory_limit').'M');
}
$mediaPath = $mediaPath ?: Setting::get('media_path');
$this->setTags($tags);

View file

@ -117,6 +117,8 @@ return [
'cache_media' => env('CACHE_MEDIA', true),
'memory_limit' => env('MEMORY_LIMIT'),
'misc' => [
'home_url' => 'https://koel.phanan.net/',
'docs_url' => 'https://koel.phanan.net/docs',