Skip to content

Commit

Permalink
updated code
Browse files Browse the repository at this point in the history
  • Loading branch information
gitofanindya committed Jul 26, 2023
1 parent 4c655da commit 8b7f56d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions nxdrive/engine/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ def _handle_pair_handler_exception(

def _synchronize_direct_transfer(self, doc_pair: DocPair, /) -> None:
"""Direct Transfer of a local path."""
log.info(f">>>>>>>>>>>>>>>>>>>>>> doc_pair: {doc_pair!r}")
session = self.dao.get_session(doc_pair.session)
if session and session.status is TransferStatus.PAUSED:
# No need to repush the *doc_pair* into the queue, it will be handled when resuming the session
Expand All @@ -569,13 +570,21 @@ def _synchronize_direct_transfer(self, doc_pair: DocPair, /) -> None:
path = Path(f"/{doc_pair.local_path}")

if not path.exists():
log.warning(
f"Cancelling Direct Transfer of {path!r} because it does not exist anymore"
)
# self._direct_transfer_cancel(doc_pair)
# self.engine.directTranferError.emit(path)
if session:
self.engine.directTranferError.emit(path)
try:
if not session:
session = self.dao.get_session(doc_pair.session)

Check warning on line 576 in nxdrive/engine/processor.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/engine/processor.py#L576

Added line #L576 was not covered by tests
log.warning(
f"Pausing Direct Transfer of {path!r} because it does not exist. \
Please validate the path and resume."
)
self.dao.pause_session(session.uid)
except Exception as e:
log.warning(

Check warning on line 583 in nxdrive/engine/processor.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/engine/processor.py#L582-L583

Added lines #L582 - L583 were not covered by tests
f"Cancelling Direct Transfer of {path!r} because it does not exist."
)
log.warning(f"Error: {e!r}")
self._direct_transfer_cancel(doc_pair)

Check warning on line 587 in nxdrive/engine/processor.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/engine/processor.py#L586-L587

Added lines #L586 - L587 were not covered by tests
return

# Do the upload
Expand Down

0 comments on commit 8b7f56d

Please sign in to comment.