Skip to content

Commit

Permalink
only check sha256 when there is something in the remote directory (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Mar 29, 2022
1 parent 4f90686 commit 221839e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dpdispatcher/ssh_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,9 @@ def upload(self,
try:
self.ssh_session.sftp.mkdir(os.path.basename(self.remote_root))
except OSError:
# mkdir failed meaning it exists, thus the job is recovered
recover = True
# mkdir failed meaning it exists
if len(self.ssh_session.sftp.listdir(os.path.basename(self.remote_root))):
recover = True
self.ssh_session.sftp.chdir(None)

cwd = os.getcwd()
Expand Down

0 comments on commit 221839e

Please sign in to comment.