Get to the point where we can start notifying the other daemon, remove TransferJob.php, add DaemonTransferRepository.php
This commit is contained in:
parent
a2eab3ca43
commit
5007ce0b1c
8 changed files with 172 additions and 115 deletions
|
@ -10,12 +10,6 @@ use Pterodactyl\Repositories\Wings\DaemonServerRepository;
|
|||
|
||||
class TransferService
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Database\ConnectionInterface
|
||||
*/
|
||||
private $connection;
|
||||
|
||||
/**
|
||||
* @var \Pterodactyl\Contracts\Repository\ServerRepositoryInterface
|
||||
*/
|
||||
|
@ -26,33 +20,29 @@ class TransferService
|
|||
*/
|
||||
private $daemonServerRepository;
|
||||
|
||||
/**
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
private $writer;
|
||||
|
||||
/**
|
||||
* TransferService constructor.
|
||||
*
|
||||
* @param \Illuminate\Database\ConnectionInterface $connection
|
||||
* @param \Pterodactyl\Repositories\Wings\DaemonServerRepository $daemonServerRepository
|
||||
* @param \Pterodactyl\Contracts\Repository\ServerRepositoryInterface $repository
|
||||
* @param \Psr\Log\LoggerInterface $writer
|
||||
*/
|
||||
public function __construct(
|
||||
ConnectionInterface $connection,
|
||||
DaemonServerRepository $daemonServerRepository,
|
||||
ServerRepositoryInterface $repository,
|
||||
LoggerInterface $writer
|
||||
ServerRepositoryInterface $repository
|
||||
) {
|
||||
$this->connection = $connection;
|
||||
$this->repository = $repository;
|
||||
$this->daemonServerRepository = $daemonServerRepository;
|
||||
$this->writer = $writer;
|
||||
}
|
||||
|
||||
public function handle(Server $server)
|
||||
/**
|
||||
* Requests an archive from the daemon.
|
||||
*
|
||||
* @param int|\Pterodactyl\Models\Server $server
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function requestArchive(Server $server)
|
||||
{
|
||||
|
||||
$this->daemonServerRepository->setServer($server)->requestArchive();
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue