mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-27 17:55:59 -04:00
fix(applications): persist restart limit state for stopped containers (#11566)
This commit is contained in:
@@ -3,13 +3,14 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Support\ValidationPatterns;
|
||||
use App\Traits\HasRestartLimit;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use RuntimeException;
|
||||
use Spatie\Url\Url;
|
||||
|
||||
class ApplicationPreview extends BaseModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
use HasRestartLimit, SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'uuid',
|
||||
@@ -102,6 +103,11 @@ class ApplicationPreview extends BaseModel
|
||||
return $this->belongsTo(Application::class);
|
||||
}
|
||||
|
||||
public function restartLimitMaximum(): int
|
||||
{
|
||||
return $this->application->max_restart_count ?? $this->max_restart_count ?? 0;
|
||||
}
|
||||
|
||||
public function persistentStorages()
|
||||
{
|
||||
return $this->morphMany(LocalPersistentVolume::class, 'resource');
|
||||
|
||||
Reference in New Issue
Block a user