Streaming Transfers (#4548)
This commit is contained in:
parent
032e4f2e31
commit
df2402b54f
6 changed files with 38 additions and 106 deletions
|
@ -2,8 +2,8 @@
|
|||
|
||||
namespace Pterodactyl\Repositories\Wings;
|
||||
|
||||
use Pterodactyl\Models\Node;
|
||||
use Lcobucci\JWT\Token\Plain;
|
||||
use Pterodactyl\Models\Server;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;
|
||||
|
||||
|
@ -12,16 +12,16 @@ class DaemonTransferRepository extends DaemonRepository
|
|||
/**
|
||||
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException
|
||||
*/
|
||||
public function notify(Server $server, Plain $token): void
|
||||
public function notify(Node $targetNode, Plain $token): void
|
||||
{
|
||||
try {
|
||||
$this->getHttpClient()->post('/api/transfer', [
|
||||
$this->getHttpClient()->post(sprintf('/api/servers/%s/transfer', $this->server->uuid), [
|
||||
'json' => [
|
||||
'server_id' => $server->uuid,
|
||||
'url' => $server->node->getConnectionAddress() . sprintf('/api/servers/%s/archive', $server->uuid),
|
||||
'server_id' => $this->server->uuid,
|
||||
'url' => $targetNode->getConnectionAddress() . '/api/transfers',
|
||||
'token' => 'Bearer ' . $token->toString(),
|
||||
'server' => [
|
||||
'uuid' => $server->uuid,
|
||||
'uuid' => $this->server->uuid,
|
||||
'start_on_completion' => false,
|
||||
],
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue