mirror of
https://github.com/tiennm99/coolify.git
synced 2026-09-02 08:20:20 +00:00
refactor(backups): centralize storage deletion guard
This commit is contained in:
@@ -96,6 +96,13 @@ class LocalFileVolume extends BaseModel
|
||||
return $this->morphMany(ScheduledVolumeBackup::class, 'backupable');
|
||||
}
|
||||
|
||||
public function abortIfScheduledBackupsExist(): void
|
||||
{
|
||||
if ($this->scheduledBackups()->exists()) {
|
||||
abort(422, 'Delete this directory backup schedule and its archives before deleting the directory.');
|
||||
}
|
||||
}
|
||||
|
||||
public function loadStorageOnServer()
|
||||
{
|
||||
if ($this->is_host_file) {
|
||||
|
||||
Reference in New Issue
Block a user