Merge pull request #4785 from reitermarkus/fix-cleanup-non-existent-sysmlink

Skip `mtime` for non-existent symlink.
This commit is contained in:
Markus Reiter 2018-09-01 07:09:15 +02:00 committed by GitHub
commit d8dc1f7fe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,8 @@ module CleanupRefinement
return false unless days
return true if days.zero?
return true if symlink? && !exist?
# TODO: Replace with ActiveSupport's `.days.ago`.
mtime < ((@time ||= Time.now) - days * 60 * 60 * 24)
end