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

Don't set up queue if write key is not set #1

Open
wants to merge 1 commit into
base: support-php-8
Choose a base branch
from
Open

Don't set up queue if write key is not set #1

wants to merge 1 commit into from

Conversation

Synchro
Copy link

@Synchro Synchro commented Sep 27, 2021

Hi,

You've done a nice job cleaning up this fork for PHP 8, but it sounds like Graham isn't too bothered about merging or maintaining it. I've already made this PR against his repo, but I figured it might do better bundled in with your changes, so i thought I'd post it here too.

It simply moves the initial queue setup inside the key check, which means that the queue cleanup functions don't get called on shutdown if you have no key. If you don't do this, and you don't have a key set, it will throw an error at the end of every request. If you don't have a key set, it then just fails quietly – which is very useful for dev or staging envs – in my case this issue was causing 32,000 exceptions/day on my staging server before I figured it out!

@Synchro
Copy link
Author

Synchro commented Sep 27, 2021

FYI, I've also done a major cleanup of Segment's upstream analytics-php library which I'm intending to PR to them - extra sets of eyes appreciated!

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

Successfully merging this pull request may close these issues.

1 participant