mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 14:33:49 +01:00
API::search method: set timeout according to the number of objects in response
This commit is contained in:
parent
15823ad677
commit
0ffbf3274a
1 changed files with 7 additions and 0 deletions
|
@ -1626,6 +1626,13 @@ function handle_api_LSobject_search($request) {
|
|||
$data['page'] = $page['nb'];
|
||||
$data['nbPages'] = $page['nbPages'];
|
||||
}
|
||||
|
||||
// Reset & increase time limit: allow one seconds by object to handle,
|
||||
// with a minimum of 30 seconds
|
||||
$timeout = count(($all?$entries:$page['list']));
|
||||
set_time_limit(($timeout>30?$timeout:30));
|
||||
|
||||
// Handle objects
|
||||
foreach(($all?$entries:$page['list']) as $obj) {
|
||||
$data['objects'][$obj -> dn] = array(
|
||||
'name' => $obj -> displayName,
|
||||
|
|
Loading…
Reference in a new issue