An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
remove unnecessary jobs
Andras Bacsaiaba0b2f13c0b
diff --git a/app/Jobs/ApplicationContainerStatusJob.php b/app/Jobs/ApplicationContainerStatusJob.phpdeleted file mode 100644index ae41a5c412..0000000000--- a/app/Jobs/ApplicationContainerStatusJob.php+++ /dev/null@@ -1,54 +0,0 @@-<?php--namespace App\Jobs;--use App\Models\Application;-use App\Models\ApplicationPreview;-use Illuminate\Bus\Queueable;-use Illuminate\Contracts\Queue\ShouldBeEncrypted;-use Illuminate\Contracts\Queue\ShouldBeUnique;-use Illuminate\Contracts\Queue\ShouldQueue;-use Illuminate\Foundation\Bus\Dispatchable;-use Illuminate\Queue\InteractsWithQueue;-use Illuminate\Queue\SerializesModels;--class ApplicationContainerStatusJob implements ShouldQueue, ShouldBeUnique, ShouldBeEncrypted-{- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;-- public string $containerName;-- public function __construct(- public Application $application,- public int $pullRequestId = 0)- {- $this->containerName = generateApplicationContainerName($application->uuid, $pullRequestId);- }-- public function uniqueId(): string- {- return $this->containerName;- }-- public function handle(): void- {- try {- $status = getApplicationContainerStatus(application: $this->application);- if ($this->application->status === 'running' && $status !== 'running') {- // $this->application->environment->project->team->notify(new StatusChanged($this->application));- }-- if ($this->pullRequestId !== 0) {- $preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pullRequestId);- $preview->status = $status;- $preview->save();- } else {- $this->application->status = $status;- $this->application->save();- }- } catch (\Throwable $e) {- ray($e->getMessage());- throw $e;- }- }-}diff --git a/app/Jobs/DatabaseContainerStatusJob.php b/app/Jobs/DatabaseContainerStatusJob.phpdeleted file mode 100644index f1d0de3015..0000000000--- a/app/Jobs/DatabaseContainerStatusJob.php+++ /dev/null@@ -1,57 +0,0 @@-<?php--namespace App\Jobs;--use App\Models\ApplicationPreview;-use App\Models\StandalonePostgresql;-use App\Notifications\Application\StatusChanged;-use Illuminate\Bus\Queueable;-use Illuminate\Contracts\Queue\ShouldBeEncrypted;-use Illuminate\Contracts\Queue\ShouldBeUnique;-use Illuminate\Contracts\Queue\ShouldQueue;-use Illuminate\Foundation\Bus\Dispatchable;-use Illuminate\Queue\InteractsWithQueue;-use Illuminate\Queue\SerializesModels;--class DatabaseContainerStatusJob implements ShouldQueue, ShouldBeUnique, ShouldBeEncrypted-{- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;-- public string $containerName;-- public function __construct(- public StandalonePostgresql $database,- ) {- $this->containerName = $database->uuid;- }-- public function uniqueId(): string- {- return $this->containerName;- }-- public function handle(): void- {- try {- $status = getContainerStatus(- server: $this->database->destination->server,- container_id: $this->containerName,- throwError: false- );-- if ($this->database->status === 'running' && $status !== 'running') {- if (data_get($this->database, 'environment.project.team')) {- // $this->database->environment->project->team->notify(new StatusChanged($this->database));- }- }- if ($this->database->status !== $status) {- $this->database->status = $status;- $this->database->save();- }- } catch (\Throwable $e) {- send_internal_notification('DatabaseContainerStatusJob failed with: ' . $e->getMessage());- ray($e->getMessage());- throw $e;- }- }-}diff --git a/app/Jobs/ProxyContainerStatusJob.php b/app/Jobs/ProxyContainerStatusJob.phpdeleted file mode 100644index 6cfd2692f7..0000000000--- a/app/Jobs/ProxyContainerStatusJob.php+++ /dev/null@@ -1,87 +0,0 @@-<?php--namespace App\Jobs;--use App\Actions\Proxy\StartProxy;-use App\Enums\ProxyStatus;-use App\Enums\ProxyTypes;-use App\Models\Server;-use Illuminate\Bus\Queueable;-use Illuminate\Contracts\Queue\ShouldBeEncrypted;-use Illuminate\Contracts\Queue\ShouldBeUnique;-use Illuminate\Contracts\Queue\ShouldQueue;-use Illuminate\Foundation\Bus\Dispatchable;-use Illuminate\Queue\InteractsWithQueue;-use Illuminate\Queue\Middleware\WithoutOverlapping;-use Illuminate\Queue\SerializesModels;--class ProxyContainerStatusJob implements ShouldQueue, ShouldBeUnique, ShouldBeEncrypted-{- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;-- public Server $server;- public $tries = 1;- public $timeout = 120;-- public function __construct(Server $server)- {- $this->server = $server;- }-- public function middleware(): array- {- return [new WithoutOverlapping($this->server->uuid)];- }-- public function uniqueId(): string- {- ray($this->server->uuid);- return $this->server->uuid;- }-- public function handle(): void- {- try {- $proxyType = data_get($this->server, 'proxy.type');- if ($proxyType === ProxyTypes::NONE->value) {- return;- }- if (is_null($proxyType)) {- if ($this->server->isProxyShouldRun()) {- $this->server->proxy->type = ProxyTypes::TRAEFIK_V2->value;- $this->server->proxy->status = ProxyStatus::EXITED->value;- $this->server->save();- resolve(StartProxy::class)($this->server);- return;- }- }-- $container = getContainerStatus(server: $this->server, all_data: true, container_id: 'coolify-proxy', throwError: false);- $containerStatus = data_get($container, 'State.Status');- $databaseContainerStatus = data_get($this->server, 'proxy.status', 'exited');--- if ($proxyType !== ProxyTypes::NONE->value) {- if ($containerStatus === 'running') {- $this->server->proxy->status = $containerStatus;- $this->server->save();- return;- }- if ((is_null($containerStatus) ||$containerStatus !== 'running' || $databaseContainerStatus !== 'running' || ($containerStatus && $databaseContainerStatus !== $containerStatus)) && $this->server->isProxyShouldRun()) {- $this->server->proxy->status = $containerStatus;- $this->server->save();- resolve(StartProxy::class)($this->server);- return;- }- }- } catch (\Throwable $e) {- if ($e->getCode() === 1) {- $this->server->proxy->status = 'exited';- $this->server->save();- }- send_internal_notification('ProxyContainerStatusJob failed with: ' . $e->getMessage());- ray($e->getMessage());- throw $e;- }- }-}