Files
coolify/app/Jobs/CheckHelperImageJob.php
T
Andras Bacsai 2db26e88ab fix(jobs): stop notifying on transient CDN failures in version checks
CheckHelperImageJob now logs a warning and returns when the versions
endpoint fails instead of sending an internal notification and
rethrowing. The next scheduled run retries. PullTemplatesFromCDN also
no longer sends internal notifications on non-success responses or
exceptions; it still logs them.

Add tests checking that the stored helper version is kept and that no
notification is sent when the CDN is unavailable.
2026-10-15 15:20:57 +02:00

39 lines
1.2 KiB
PHP

<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class CheckHelperImageJob implements ShouldBeEncrypted, ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $timeout = 1000;
public function __construct() {}
public function handle(): void
{
$response = Http::retry(3, 1000, throw: false)->get(config('constants.coolify.versions_url'));
if ($response->failed()) {
// The CDN can be briefly unavailable. The next scheduled run tries again, so do not notify.
Log::warning('CheckHelperImageJob could not fetch versions', ['status' => $response->status()]);
return;
}
$latest_version = data_get($response->json(), 'coolify.helper.version');
$settings = instanceSettings();
if (version_compare($latest_version, $settings->helper_version, '>')) {
$settings->update(['helper_version' => $latest_version]);
}
}
}