📯 tRaNsFeR lOgS 📯
This commit is contained in:
parent
e6c4a68e4a
commit
5c5e2e24f1
12 changed files with 149 additions and 65 deletions
|
@ -6,6 +6,7 @@ use Webmozart\Assert\Assert;
|
|||
use Pterodactyl\Models\Server;
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
use Pterodactyl\Repositories\Wings\DaemonServerRepository;
|
||||
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
|
||||
|
||||
class SuspensionService
|
||||
{
|
||||
|
@ -56,6 +57,11 @@ class SuspensionService
|
|||
return;
|
||||
}
|
||||
|
||||
// Check if the server is currently being transferred.
|
||||
if ($server->transfer !== null) {
|
||||
throw new ConflictHttpException('Server is currently being transferred');
|
||||
}
|
||||
|
||||
$this->connection->transaction(function () use ($action, $server) {
|
||||
$server->update([
|
||||
'suspended' => $action === self::ACTION_SUSPEND,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue