Skip to content

Commit

Permalink
Improve reliability of detecting upload available.
Browse files Browse the repository at this point in the history
Detecting a !ready file being placed into the upload directory is
problematic, due to possible races in setting watches on a just created
directory.

So instead, we just watch for a file touched when the sftp session ends.

This means we more reliably detect when a !ready file has been uploaded,
at the cost of doing extra scans (in the probably rare case) when a sftp
session hasn't uploaded a !ready file.
  • Loading branch information
jon-turney committed Dec 18, 2024
1 parent 844a307 commit 70fa7c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion calm/calm.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ def sighup(signum, frame):
action |= Event.read_relarea
elif path.startswith(args.stagingdir) and (filename != 'tmp'):
action |= Event.read_uploads
elif (path.startswith(args.homedir)) and (filename == "!ready"):
elif (path.startswith(args.homedir)) and (filename == ".sftp-session-close"):
action |= Event.read_uploads
else:
# None means no more events are currently available, so
Expand Down

0 comments on commit 70fa7c9

Please sign in to comment.