Skip to content

Commit

Permalink
Merge pull request #863 from bakaphp/hotfix-queue
Browse files Browse the repository at this point in the history
  • Loading branch information
kaioken authored May 18, 2023
2 parents c5dad83 + 0fdd45f commit a1aa2c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/Cli/Tasks/QueueTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function jobsAction(?string $queueName = null)
return;
}

go(function () use ($job, $msg, $sentryClient) {
go(function () use ($job, $msg) {
//instance notification and pass the entity
try {
$this->reconnectDb();
Expand All @@ -179,10 +179,6 @@ public function jobsAction(?string $queueName = null)
$e->getTraceAsString(),
]
);

if ($sentryClient) {
$sentryClient->flush();
}
}
});
} catch (Throwable $e) {
Expand Down
3 changes: 2 additions & 1 deletion src/Providers/LoggerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Sentry\ClientBuilder;
use Sentry\Monolog\Handler as SentryHandler;
use Sentry\State\Hub;
use function Baka\isCLI;

class LoggerProvider implements ServiceProviderInterface
{
Expand Down Expand Up @@ -43,7 +44,7 @@ function () use ($container) {
$handler->setFormatter($formatter);

//only run logs in production
if ((bool) envValue('SENTRY_PROJECT', 0)) {
if ((bool) envValue('SENTRY_PROJECT', 0) && !isCLI()) {
//sentry logger
$client = ClientBuilder::create([
'dsn' => 'https://' . getenv('SENTRY_PROJECT_SECRET') . '@sentry.io/' . getenv('SENTRY_PROJECT_ID')
Expand Down

0 comments on commit a1aa2c5

Please sign in to comment.