Skip to content

Commit

Permalink
BeforeHandle instead of BootApplication
Browse files Browse the repository at this point in the history
  • Loading branch information
huangdijia committed Nov 25, 2024
1 parent e6a6754 commit 27f92b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Listener/FetchRecordingOnBootListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use FriendsOfHyperf\Telescope\PipeMessage;
use FriendsOfHyperf\Telescope\TelescopeConfig;
use Hyperf\Command\Event\BeforeHandle;
use Hyperf\Contract\ConfigInterface;
use Hyperf\Contract\ContainerInterface;
use Hyperf\Contract\StdoutLoggerInterface;
Expand Down Expand Up @@ -41,7 +42,7 @@ public function __construct(
public function listen(): array
{
return [
BootApplication::class,
BeforeHandle::class,
MainWorkerStart::class,
MainCoroutineServerStart::class,
];
Expand All @@ -52,7 +53,7 @@ public function listen(): array
*/
public function process(object $event): void
{
if ($event instanceof BootApplication) {
if ($event instanceof BeforeHandle) {
$this->config->set('telescope.recording', (bool) $this->telescopeConfig->fetchRecording());
return;
}
Expand Down

0 comments on commit 27f92b8

Please sign in to comment.