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

Fix missing sentryMonitor macro when command is called outside the CLI environment #812

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

rzv-me
Copy link
Contributor

@rzv-me rzv-me commented Nov 29, 2023

This is a PR to fix the problem described by the #805 issue.

The problem is that whenever an artisan command is called when not running in console, the schedule method on the ConsoleKernel is executed.

This happens on Laravel Vapor, for example, where the config is cached on the fly with $app->make(ConsoleKernelContract::class)->call('config:cache'); in vendor/laravel/vapor-core/stubs/fpmRuntime.php

this can be replicated easily, by doing Artisan::call('inspire'); in a controller.

@cleptric cleptric linked an issue Dec 4, 2023 that may be closed by this pull request
Copy link
Collaborator

@stayallive stayallive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a awkward situation but I guess it's not the worst. Been thinking if there was another way we could better fix this. I guess we would need a bootWhenNotApplicable or something otherwise. But since the inactive version only adds a simple closure to an array this is fine for now. Thanks!

@stayallive stayallive changed the title Update ConsoleIntegration.php to always register the empty sentryMoni… Fix missing sentryMonitor macro when command is called outside the CLI environment Dec 8, 2023
@cleptric cleptric merged commit 9d469fe into getsentry:master Dec 12, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cron monitors not working
3 participants