-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
Hi everyone,
I got the too many open files error.
Error: include(/home/forge/xxxx/vendor/guzzlehttp/promises/src/RejectedPromise.php): Failed to open stream: Too many open files
I get the error in a job when I delete orders (12k orders). Graphql delete single order each time that's why I suspect it happens because Guzzle doesn't close connection and it stucks the system.
How I can reset the connection end of the process each time?
My code sample
$orderService->deleteOrder($shop, ['id' => $orderId]);
public function deleteOrder(User $shop, $variables = [])
{
$query = <<<GQL
mutation(\$id: ID!) {
orderDelete(orderId: \$id) {
deletedId
userErrors {
field
message
}
}
}
GQL;
$result = $shop->api()->graph($query, $variables);
if ($result['status'] === 429) {
dd($result);
}
return $result['body']['data']->toArray();
}
Metadata
Metadata
Assignees
Labels
No labels