Skip to content

Commit 7891040

Browse files
committed
feat: inject GithubService into ProcessAggregatedEvents for commenting functionality
1 parent a62daa9 commit 7891040

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Jobs/ProcessAggregatedEvents.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ class ProcessAggregatedEvents implements ShouldQueue
2020

2121
protected string $nodeId;
2222

23+
protected GithubService $githubService;
24+
2325
/**
2426
* Create a new job instance.
2527
*/
26-
public function __construct(string $nodeId)
28+
public function __construct(string $nodeId, GithubService $githubService)
2729
{
2830
$this->nodeId = $nodeId;
31+
$this->githubService = $githubService;
2932
}
3033

3134
/**
@@ -55,8 +58,7 @@ public function handle(): void
5558
)->render();
5659

5760
Log::info('ProcessAggregatedEvents: Message: '.$message);
58-
$githubService = new GithubService;
59-
$githubService->commentOnNode($this->nodeId, $message);
61+
$this->githubService->commentOnNode($this->nodeId, $message);
6062
}
6163

6264
/**

0 commit comments

Comments
 (0)