Skip to content

Commit

Permalink
[Chore] Only skip scheduled tests (#1803)
Browse files Browse the repository at this point in the history
only skip scheduled tests
  • Loading branch information
alexjustesen authored Nov 21, 2024
1 parent 073ffe7 commit 6c01aad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/Actions/Speedtests/RunOoklaSpeedtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public function handle(?int $serverId = null, bool $scheduled = false): void

SpeedtestStarted::dispatch($result);

ExecuteOoklaSpeedtest::dispatch(result: $result, serverId: $serverId);
ExecuteOoklaSpeedtest::dispatch(result: $result, serverId: $serverId, scheduled: $scheduled);
}
}
19 changes: 11 additions & 8 deletions app/Jobs/Speedtests/ExecuteOoklaSpeedtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ExecuteOoklaSpeedtest implements ShouldBeUnique, ShouldQueue
public function __construct(
public Result $result,
public ?int $serverId = null,
public bool $scheduled = false,
) {}

/**
Expand All @@ -48,17 +49,19 @@ public function handle(): void
return;
}

$externalIp = GetExternalIpAddress::run();
if ($this->scheduled) {
$externalIp = GetExternalIpAddress::run();

$shouldSkip = $this->shouldSkip($externalIp);
$shouldSkip = $this->shouldSkip($externalIp);

if ($shouldSkip !== false) {
$this->markAsSkipped(
message: $shouldSkip,
externalIp: $externalIp,
);
if ($shouldSkip !== false) {
$this->markAsSkipped(
message: $shouldSkip,
externalIp: $externalIp,
);

return;
return;
}
}

// Execute Speedtest
Expand Down

0 comments on commit 6c01aad

Please sign in to comment.