-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathReportGetDocument.php
44 lines (37 loc) · 1.02 KB
/
ReportGetDocument.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
declare(strict_types=1);
/**
*
* @author xiaoguo0426
* @contact [email protected]
* @license MIT
*/
namespace App\Command\Amazon\Report;
use App\Queue\AmazonGetReportDocumentQueue;
use Hyperf\Command\Annotation\Command;
use Hyperf\Command\Command as HyperfCommand;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
#[Command]
class ReportGetDocument extends HyperfCommand
{
public function __construct(protected ContainerInterface $container)
{
parent::__construct('amazon:report:gets-document');
}
public function configure(): void
{
parent::configure();
$this->setDescription('Amazon Gets Report Document Command');
}
/**
* @throws \JsonException
* @return void
*/
public function handle(): void
{
// (new AmazonGetReportDocumentQueue())->pop();//单个请求拉取报告
(new AmazonGetReportDocumentQueue())->coPop(30);//并行请求的数量
}
}