Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Update worker docs - fix worker sample #145

Merged
merged 3 commits into from
Aug 7, 2023

Conversation

wapmorgan
Copy link
Contributor

We need to avoid infinity cycle

We need to avoid infinity cycle
@roxblnfk
Copy link

roxblnfk commented Aug 7, 2023

Hello ✋

In your case we have some chance to get undefined $request in the beginning when an external RequestFactory fails on parsing the first request.

I think it will be better to fix it using that code:

// ...

while (true) {
    try {
        $request = $psr7->waitRequest();
        if ($request === null) {
            break;
        }
    } catch (\Throwable $e) {

        // ...

@rustatian rustatian self-requested a review August 7, 2023 21:35
@rustatian rustatian added the bug Something isn't working label Aug 7, 2023
@rustatian
Copy link
Member

Thank you guys 👍🏻

@rustatian rustatian merged commit 979362f into roadrunner-server:2023.x Aug 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants