Skip to content

Commit

Permalink
Fix commands not being available for synchronous web event handlers
Browse files Browse the repository at this point in the history
Beam currently emits synchronous events in some API handlers which
effectively call Commands with a specific options and arguments.
In order to run the command, it needs to be registered also for
web requests, therefore we need to remove the CLI condition
during the command registration process.

remp/remp#1292

(cherry picked from commit 2a4c83a)
  • Loading branch information
rootpd committed Aug 11, 2023
1 parent aac7a89 commit 1704b51
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions Beam/extensions/beam-module/src/BeamServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,28 +209,26 @@ public function register()

protected function registerCommands(): void
{
if ($this->app->runningInConsole()) {
$this->commands([
Console\Commands\AggregateArticlesViews::class,
Console\Commands\AggregateConversionEvents::class,
Console\Commands\AggregatePageviewLoadJob::class,
Console\Commands\AggregatePageviews::class,
Console\Commands\AggregatePageviewTimespentJob::class,
Console\Commands\CompressAggregations::class,
Console\Commands\CompressSnapshots::class,
Console\Commands\ComputeAuthorsSegments::class,
Console\Commands\ComputeSectionSegments::class,
Console\Commands\DashboardRefresh::class,
Console\Commands\DeleteDuplicatePageviews::class,
Console\Commands\DeleteOldAggregations::class,
Console\Commands\ElasticDataRetention::class,
Console\Commands\ElasticWriteAliasRollover::class,
Console\Commands\ProcessConversionSources::class,
Console\Commands\ProcessPageviewLoyalVisitors::class,
Console\Commands\ProcessPageviewSessions::class,
Console\Commands\SendNewslettersCommand::class,
Console\Commands\SnapshotArticlesViews::class,
]);
}
$this->commands([
Console\Commands\AggregateArticlesViews::class,
Console\Commands\AggregateConversionEvents::class,
Console\Commands\AggregatePageviewLoadJob::class,
Console\Commands\AggregatePageviews::class,
Console\Commands\AggregatePageviewTimespentJob::class,
Console\Commands\CompressAggregations::class,
Console\Commands\CompressSnapshots::class,
Console\Commands\ComputeAuthorsSegments::class,
Console\Commands\ComputeSectionSegments::class,
Console\Commands\DashboardRefresh::class,
Console\Commands\DeleteDuplicatePageviews::class,
Console\Commands\DeleteOldAggregations::class,
Console\Commands\ElasticDataRetention::class,
Console\Commands\ElasticWriteAliasRollover::class,
Console\Commands\ProcessConversionSources::class,
Console\Commands\ProcessPageviewLoyalVisitors::class,
Console\Commands\ProcessPageviewSessions::class,
Console\Commands\SendNewslettersCommand::class,
Console\Commands\SnapshotArticlesViews::class,
]);
}
}

0 comments on commit 1704b51

Please sign in to comment.