mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 23:03:45 +02:00
Don't prevent deletion if a DB host is unreachable and it is a force delete; closes #2085
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Pterodactyl\Services\Servers;
|
||||
|
||||
use Exception;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
@@ -109,7 +110,15 @@ class ServerDeletionService
|
||||
|
||||
$this->connection->transaction(function () use ($server) {
|
||||
$this->databaseRepository->setColumns('id')->findWhere([['server_id', '=', $server->id]])->each(function ($item) {
|
||||
$this->databaseManagementService->delete($item->id);
|
||||
try {
|
||||
$this->databaseManagementService->delete($item->id);
|
||||
} catch (Exception $exception) {
|
||||
if ($this->force) {
|
||||
$this->writer->warning($exception);
|
||||
} else {
|
||||
throw $exception;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$this->repository->delete($server->id);
|
||||
|
||||
Reference in New Issue
Block a user