Skip to content
Open
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
9 changes: 7 additions & 2 deletions src/Licensing/Radio.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ class Radio
const PING_CACHE_KEY = 'statamic.outpost.pinged';
const PING_INTERVAL = 300; // seconds

public function __construct(private Outpost $outpost)
public function __construct(private ?Outpost $outpost = null)
{
}

private function outpost(): Outpost
{
return $this->outpost ??= app(Outpost::class);
}

public function ping(): void
{
if (! $this->markAsPinged()) {
Expand All @@ -39,7 +44,7 @@ public function forcePing(): void
private function contactOutpost(): void
{
try {
$this->outpost->radio();
$this->outpost()->radio();
} catch (Throwable $e) {
Log::debug('Error contacting Outpost: '.$e->getMessage());
}
Expand Down
Loading