kopia lustrzana https://github.com/nextcloud/social
Async the process only if there is request in STANDBY
rodzic
b534b11664
commit
a7cee453c7
|
@ -93,19 +93,21 @@ class QueueController extends Controller {
|
|||
* @param string $token
|
||||
*/
|
||||
public function asyncWithToken(string $token) {
|
||||
$this->async();
|
||||
|
||||
$requests = $this->queueService->getRequestFromToken($token, RequestQueue::STATUS_STANDBY);
|
||||
$this->activityService->manageInit();
|
||||
foreach ($requests as $request) {
|
||||
$request->setTimeout(ActivityService::TIMEOUT_ASYNC);
|
||||
try {
|
||||
$this->activityService->manageRequest($request);
|
||||
} catch (RequestException $e) {
|
||||
} catch (SocialAppConfigException $e) {
|
||||
|
||||
if (sizeof($requests) > 0) {
|
||||
$this->async();
|
||||
|
||||
$this->activityService->manageInit();
|
||||
foreach ($requests as $request) {
|
||||
$request->setTimeout(ActivityService::TIMEOUT_ASYNC);
|
||||
try {
|
||||
$this->activityService->manageRequest($request);
|
||||
} catch (RequestException $e) {
|
||||
} catch (SocialAppConfigException $e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// or it will feed the logs.
|
||||
exit();
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue