Browse Source

Fix receiving

unifiedWindowUI
Luke Murphy 4 years ago
parent
commit
fc5ebcf136
No known key found for this signature in database GPG Key ID: 5E2EF5A63E3718CC
  1. 5
      dropship/dropship.py
  2. 3
      dropship/wormhole.py

5
dropship/dropship.py

@ -150,6 +150,5 @@ class DropShip:
log.info(f"send: successfully initiated transfer send ({code})") log.info(f"send: successfully initiated transfer send ({code})")
async def receive(self, code): async def receive(self, code):
await self.nursery.start(wormhole_recv, code) await self.nursery.start(wormhole_recv, code, self)
self._remove_pending_transfer(code) log.info(f"send: successfully initiated receive ({code})")
log.info(f"receive: successfully received transfer ({code})")

3
dropship/wormhole.py

@ -22,7 +22,7 @@ async def wormhole_send(fpath, task_status=TASK_STATUS_IGNORED):
log.info(f"wormhole_send: succesfully terminated process ({code})") log.info(f"wormhole_send: succesfully terminated process ({code})")
async def wormhole_recv(code, task_status=TASK_STATUS_IGNORED): async def wormhole_recv(code, parent, task_status=TASK_STATUS_IGNORED):
"""Run `wormhole receive` on a pending transfer code.""" """Run `wormhole receive` on a pending transfer code."""
with CancelScope() as scope: with CancelScope() as scope:
command = ["wormhole", "receive", "--accept-file", code] command = ["wormhole", "receive", "--accept-file", code]
@ -30,6 +30,7 @@ async def wormhole_recv(code, task_status=TASK_STATUS_IGNORED):
task_status.started((scope,)) task_status.started((scope,))
log.info(f"wormhole_recv: now starting receiving process ({code})") log.info(f"wormhole_recv: now starting receiving process ({code})")
await process.wait() await process.wait()
parent._remove_pending_transfer(code)
log.info(f"wormhole_recv: succesfully received ({code})") log.info(f"wormhole_recv: succesfully received ({code})")
if scope.cancel_called: if scope.cancel_called:

Loading…
Cancel
Save