Async the process only if there is request in STANDBY

pull/177/head
Maxence Lange 2018-12-08 10:32:54 -01:00
rodzic b534b11664
commit a7cee453c7
1 zmienionych plików z 12 dodań i 10 usunięć

Wyświetl plik

@ -93,9 +93,11 @@ class QueueController extends Controller {
* @param string $token
*/
public function asyncWithToken(string $token) {
$requests = $this->queueService->getRequestFromToken($token, RequestQueue::STATUS_STANDBY);
if (sizeof($requests) > 0) {
$this->async();
$requests = $this->queueService->getRequestFromToken($token, RequestQueue::STATUS_STANDBY);
$this->activityService->manageInit();
foreach ($requests as $request) {
$request->setTimeout(ActivityService::TIMEOUT_ASYNC);
@ -105,7 +107,7 @@ class QueueController extends Controller {
} catch (SocialAppConfigException $e) {
}
}
}
// or it will feed the logs.
exit();
}