diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index a64c47597a..8488b341f0 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -46,7 +46,7 @@ App::post('/v1/functions') ->param('vars', [], new Assoc(), 'Key-value JSON object that will be passed to the function as environment variables.', true) ->param('events', [], new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)), 'Events list.', true) ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true) - ->param('timeout', 15, new Range(1, 900), 'Function maximum execution time in seconds.', true) + ->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Function maximum execution time in seconds.', true) ->inject('response') ->inject('dbForProject') ->action(function ($functionId, $name, $execute, $runtime, $vars, $events, $schedule, $timeout, $response, $dbForProject) { @@ -294,7 +294,7 @@ App::put('/v1/functions/:functionId') ->param('vars', [], new Assoc(), 'Key-value JSON object that will be passed to the function as environment variables.', true) ->param('events', [], new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)), 'Events list.', true) ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true) - ->param('timeout', 15, new Range(1, 900), 'Maximum execution time in seconds.', true) + ->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Maximum execution time in seconds.', true) ->inject('response') ->inject('dbForProject') ->inject('project')