Skip to content

Commit afdc480

Browse files
authored
Fix lock validation logic in downloader synchronization (#246)
Correct the elapsed time comparison for lock file validation. Lock files should be considered valid when they are recent (< 10 seconds), not when they are old (> 10 seconds). - Before: Lock files older than 10 seconds were considered valid - After: Lock files newer than 10 seconds are considered valid Originally suggested in a Copilot [review](red-data-tools/red-remote-input#10 (comment))
1 parent f8c1baa commit afdc480

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/datasets/downloader.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def download(output_path, &block)
122122
# The process that acquired the lock will be exited before
123123
# it stores its process ID.
124124
elapsed_time = Time.now - lock_path.mtime
125-
valid_lock_path = (elapsed_time > 10)
125+
valid_lock_path = (elapsed_time < 10)
126126
else
127127
begin
128128
Process.getpgid(pid)

0 commit comments

Comments
 (0)