Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many open files error #150

Open
tnsezer opened this issue Jan 3, 2025 · 0 comments
Open

Too many open files error #150

tnsezer opened this issue Jan 3, 2025 · 0 comments

Comments

@tnsezer
Copy link

tnsezer commented Jan 3, 2025

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();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant