Skip to content

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.

fix: remove blocking instant_remote_process and hide button during download

Andras Bacsaid37378ec0268
diff --git a/app/Livewire/Project/Database/Import.php b/app/Livewire/Project/Database/Import.php
index ad018a1eb4..bb4f755aa8 100644
--- a/app/Livewire/Project/Database/Import.php
+++ b/app/Livewire/Project/Database/Import.php
@@ -394,12 +394,9 @@ EOD;
// Create download directory on server
$commands[] = "mkdir -p {$downloadDir}";
- // Check if container exists and remove it
+ // Check if container exists and remove it (done in the command queue to avoid blocking)
$containerName = "s3-restore-{$this->resource->uuid}";
- $containerExists = instant_remote_process(["docker ps -a -q -f name={$containerName}"], $this->server, false);
- if (filled($containerExists)) {
- instant_remote_process(["docker rm -f {$containerName}"], $this->server, false);
- }
+ $commands[] = "docker rm -f {$containerName} 2>/dev/null || true";
// Run MinIO client container to download file
$commands[] = "docker run -d --name {$containerName} --rm -v {$downloadDir}:{$downloadDir} {$fullImageName} sleep 30";
diff --git a/resources/views/livewire/project/database/import.blade.php b/resources/views/livewire/project/database/import.blade.php
index b8bed1d444..cc30320192 100644
--- a/resources/views/livewire/project/database/import.blade.php
+++ b/resources/views/livewire/project/database/import.blade.php
@@ -138,7 +138,7 @@
</x-forms.button>
</div>
- <div x-show="s3FileSize && !s3DownloadedFile" class="pt-2">
+ <div x-show="s3FileSize && !s3DownloadedFile && !s3DownloadInProgress" class="pt-2">
<div class="text-sm">File found in S3 ({{ formatBytes($s3FileSize ?? 0) }})</div>
<div class="flex gap-2 pt-2">
<x-forms.button class="w-full" wire:click='downloadFromS3'>