Skip to content

Client doesn't work with Laravel Queue #30

@georgecoca

Description

@georgecoca

Hi,

We have this package installed in a Laravel application. The app listens for events for some specific events which are queued and processed in background (through queues). The thing is that when the queued jobs are processed we also submit the events to PostHog, eg:

        PostHog::capture([
            'distinctId' => 'user:1',
            'event' => 'some-event'
        ]);

But we found out that the event is never sent to PostHog. There are no errors, it just does nothing. We tested the same app locally (without queue) and it works as expected. Also we tested making a HTTP request directly to the API through the Guzzle client and it works fine. After some debugging I think there may be some issues with the consumers clients (which by default is lib_curl.), and I guess its related to how __destruct function handles the code within a queued job in Laravel app.

Laravel Version 8.75.0
Queue Jobs are processed with the command php artisan queue:work.

Looking forward to a solution. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions