Skip to content

Commit 44c00d6

Browse files
committed
fix: job signatures
1 parent 9a1290a commit 44c00d6

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

app/Jobs/SponsorServices/PublishSponsorServiceDomainEventsJob.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,22 @@ final class PublishSponsorServiceDomainEventsJob implements ShouldQueue
3030
{
3131
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
3232

33-
/**
34-
* @param array $payload
35-
* @param string $event_type
36-
* @throws \Exception
37-
*/
38-
public function handle(array $payload, string $event_type): void
33+
private $payload;
34+
35+
private $event_type;
36+
37+
public function __construct(array $payload, string $event_type){
38+
$this->payload = $payload;
39+
$this->event_type = $event_type;
40+
Log::debug(sprintf("PublishSponsorServiceDomainEventsJob::__construct payload %s event_type %s ", json_encode($payload), $event_type));
41+
}
42+
43+
public function handle(): void
3944
{
4045
try {
41-
Log::debug(sprintf("PublishSponsorServiceDomainEventsJob::handle payload %s event_type %s", json_encode($payload), json_encode($event_type)));
46+
Log::debug(sprintf("PublishSponsorServiceDomainEventsJob::handle payload %s event_type %s", json_encode($this->payload), $this->event_type));
4247
$sponsor_services_publisher = RabbitPublisherFactory::make('domain_events_message_broker');
43-
$sponsor_services_publisher->publish($payload, $event_type);
48+
$sponsor_services_publisher->publish($this->payload, $this->event_type);
4449
} catch (\Exception $ex) {
4550
Log::error($ex);
4651
throw $ex;

0 commit comments

Comments
 (0)