Skip to content

Commit 496313c

Browse files
committed
Improve task messages & add headers to http client
1 parent 69c3cf3 commit 496313c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/Worker/Command/RunCommand.php

+13-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
class RunCommand extends Command
2020
{
2121
public const ALLOWED_TASKS = [
22+
'task-refund-bid',
23+
'task-refund-nft',
2224
'task-transfer-nft',
23-
'task-transfer-token',
25+
'task-payment',
26+
'task-payment-fees',
2427
];
2528

2629
public const STATUS_OK = 'OK';
@@ -34,7 +37,11 @@ class RunCommand extends Command
3437

3538
public function __construct()
3639
{
37-
$this->httpClient = HttpClient::create();
40+
$this->httpClient = HttpClient::create([
41+
'headers' => [
42+
'User-Agent' => 'AuctionX Worker'
43+
]
44+
]);
3845

3946
parent::__construct();
4047
}
@@ -91,10 +98,13 @@ private function runProcess(): int
9198

9299
try {
93100
switch ($message['task']) {
101+
case 'task-refund-nft':
94102
case 'task-transfer-nft':
95103
$response = $this->immutableXClient->transferNft($message['body']);
96104
break;
97-
case 'task-transfer-token':
105+
case 'task-refund-bid':
106+
case 'task-payment':
107+
case 'task-payment-fees':
98108
$response = $this->immutableXClient->transferToken($message['body']);
99109
break;
100110
}

0 commit comments

Comments
 (0)