Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore] Only skip scheduled tests #1803

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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