Skip to content

Commit 95fde85

Browse files
authored
Preferentially use configuration to improve startup speed (#5020)
1 parent 4f62bbb commit 95fde85

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

src/Aspect/AsyncQueueAspect.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
use Hyperf\AsyncQueue\AnnotationJob;
1616
use Hyperf\AsyncQueue\Driver\DriverFactory;
1717
use Hyperf\AsyncQueue\Environment;
18-
use Hyperf\Di\Annotation\Aspect;
1918
use Hyperf\Di\Aop\AbstractAspect;
2019
use Hyperf\Di\Aop\ProceedingJoinPoint;
2120
use Psr\Container\ContainerInterface;
2221

23-
#[Aspect]
2422
class AsyncQueueAspect extends AbstractAspect
2523
{
2624
public array $annotations = [

src/Command/FlushFailedMessageCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
namespace Hyperf\AsyncQueue\Command;
1313

1414
use Hyperf\AsyncQueue\Driver\DriverFactory;
15-
use Hyperf\Command\Annotation\Command;
1615
use Hyperf\Command\Command as HyperfCommand;
1716
use Psr\Container\ContainerInterface;
1817
use Symfony\Component\Console\Input\InputArgument;
1918
use Symfony\Component\Console\Input\InputOption;
2019

21-
#[Command]
2220
class FlushFailedMessageCommand extends HyperfCommand
2321
{
2422
protected ContainerInterface $container;

src/Command/InfoCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@
1212
namespace Hyperf\AsyncQueue\Command;
1313

1414
use Hyperf\AsyncQueue\Driver\DriverFactory;
15-
use Hyperf\Command\Annotation\Command;
1615
use Hyperf\Command\Command as HyperfCommand;
1716
use Psr\Container\ContainerInterface;
1817
use Symfony\Component\Console\Input\InputArgument;
1918

20-
#[Command]
2119
class InfoCommand extends HyperfCommand
2220
{
2321
protected ContainerInterface $container;

src/Command/ReloadFailedMessageCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
namespace Hyperf\AsyncQueue\Command;
1313

1414
use Hyperf\AsyncQueue\Driver\DriverFactory;
15-
use Hyperf\Command\Annotation\Command;
1615
use Hyperf\Command\Command as HyperfCommand;
1716
use Psr\Container\ContainerInterface;
1817
use Symfony\Component\Console\Input\InputArgument;
1918
use Symfony\Component\Console\Input\InputOption;
2019

21-
#[Command]
2220
class ReloadFailedMessageCommand extends HyperfCommand
2321
{
2422
protected ContainerInterface $container;

src/ConfigProvider.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,23 @@
1111
*/
1212
namespace Hyperf\AsyncQueue;
1313

14+
use Hyperf\AsyncQueue\Aspect\AsyncQueueAspect;
15+
use Hyperf\AsyncQueue\Command\FlushFailedMessageCommand;
16+
use Hyperf\AsyncQueue\Command\InfoCommand;
17+
use Hyperf\AsyncQueue\Command\ReloadFailedMessageCommand;
18+
1419
class ConfigProvider
1520
{
1621
public function __invoke(): array
1722
{
1823
return [
19-
'annotations' => [
20-
'scan' => [
21-
'paths' => [
22-
__DIR__,
23-
],
24-
],
24+
'aspects' => [
25+
AsyncQueueAspect::class,
26+
],
27+
'commands' => [
28+
FlushFailedMessageCommand::class,
29+
InfoCommand::class,
30+
ReloadFailedMessageCommand::class,
2531
],
2632
'publish' => [
2733
[

0 commit comments

Comments
 (0)