Skip to content

Commit 221839e

Browse files
authored
only check sha256 when there is something in the remote directory (#172)
1 parent 4f90686 commit 221839e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dpdispatcher/ssh_context.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,9 @@ def upload(self,
334334
try:
335335
self.ssh_session.sftp.mkdir(os.path.basename(self.remote_root))
336336
except OSError:
337-
# mkdir failed meaning it exists, thus the job is recovered
338-
recover = True
337+
# mkdir failed meaning it exists
338+
if len(self.ssh_session.sftp.listdir(os.path.basename(self.remote_root))):
339+
recover = True
339340
self.ssh_session.sftp.chdir(None)
340341

341342
cwd = os.getcwd()

0 commit comments

Comments
 (0)