Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Radu Carpa committed Jan 19, 2024
1 parent 9d92100 commit f46b65d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/rucio/transfertool/bittorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
from .bittorrent_driver import BittorrentDriver

if TYPE_CHECKING:
from rucio.core.request import DirectTransfer
from rucio.core.rse import RseData
from rucio.core import transfer as transfer_core

DRIVER_NAME_RSE_ATTRIBUTE = 'bittorrent_driver'
DRIVER_CLASSES_BY_NAME: dict[str, Type[BittorrentDriver]] = {}
Expand Down Expand Up @@ -90,9 +90,9 @@ def _get_torrent_meta(scope: "types.InternalScope", name: str) -> tuple[bytes, b
@classmethod
def submission_builder_for_path(
cls: "Type[BittorrentTransfertool]",
transfer_path: "list[transfer_core.DirectTransferDefinitions]",
transfer_path: "list[DirectTransfer]",
logger: types.LoggerFunction = logging.log
) -> "tuple[list[transfer_core.DirectTransferDefinitions], Optional[TransferToolBuilder]]":
) -> "tuple[list[DirectTransfer], Optional[TransferToolBuilder]]":
hop = transfer_path[0]
if hop.rws.byte_count == 0:
logger(logging.INFO, f"Bittorrent cannot transfer fully empty torrents. Skipping {hop}")
Expand All @@ -115,7 +115,7 @@ def submission_builder_for_path(

return [hop], TransferToolBuilder(cls, external_host='Bittorrent Transfertool')

def group_into_submit_jobs(self, transfer_paths: "Sequence[list[transfer_core.DirectTransferDefinitions]]") -> dict[str, Any]:
def group_into_submit_jobs(self, transfer_paths: "Sequence[list[DirectTransfer]]") -> dict[str, Any]:
return [{'transfers': transfer_path, 'job_params': {}} for transfer_path in transfer_paths]

@staticmethod
Expand All @@ -127,7 +127,7 @@ def _connect_without_tracker(torrent_id: str, peers_drivers: Sequence[Bittorrent
for driver in peers_drivers:
driver.add_peers(torrent_id=torrent_id, peers=peer_addr)

def submit(self, transfers: "Sequence[transfer_core.DirectTransferDefinitions]", job_params: dict[str, str], timeout: Optional[int] = None) -> str:
def submit(self, transfers: "Sequence[DirectTransfer]", job_params: dict[str, str], timeout: Optional[int] = None) -> str:
[transfer] = transfers
rws = transfer.rws

Expand Down

0 comments on commit f46b65d

Please sign in to comment.