Out of memory error on OAuth2 client edition
on client that has a big number of voided accesstoken, the edit client ui on web interface was erroring due a out of memory exception for PHP process. Change-Id: Iaf2f70b710571f8139bfdb9b42f4cfe4dd4bee80
This commit is contained in:
parent
6e7136da56
commit
dc272d6ab0
@ -1352,7 +1352,8 @@ final class TokenService implements ITokenService
|
|||||||
throw new AbsentClientException(sprintf("client id %d does not exists!", $client_id));
|
throw new AbsentClientException(sprintf("client id %d does not exists!", $client_id));
|
||||||
}
|
}
|
||||||
$res = array();
|
$res = array();
|
||||||
$access_tokens = $client->access_tokens()->get();
|
// not void condition
|
||||||
|
$access_tokens = $client->access_tokens()->whereRaw(" DATE_ADD(created_at, INTERVAL lifetime second) >= UTC_TIMESTAMP() ")->get();
|
||||||
foreach ($access_tokens as $access_token) {
|
foreach ($access_tokens as $access_token) {
|
||||||
if (!$access_token->isVoid()) {
|
if (!$access_token->isVoid()) {
|
||||||
array_push($res, $access_token);
|
array_push($res, $access_token);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user