📯 tRaNsFeR lOgS 📯

This commit is contained in:
Matthew Penner 2020-12-16 16:55:44 -07:00
parent e6c4a68e4a
commit 5c5e2e24f1
12 changed files with 149 additions and 65 deletions

View file

@ -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,