Skip to content

Commit 816b2ea

Browse files
author
Kevin Paulisse
committed
Ignore errors from directory cleanup
1 parent 900ecb4 commit 816b2ea

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/octocatalog-diff/catalog/computed.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,13 @@ def environment
8989
def cleanup_checkout_dir(checkout_dir, logger)
9090
return unless File.directory?(checkout_dir)
9191
logger.debug("Cleaning up temporary directory #{checkout_dir}")
92-
FileUtils.remove_entry_secure checkout_dir
92+
# Sometimes this seems to break when handling the recursive removal when running under
93+
# a parallel environment. Trap and ignore the errors here if we don't care about them.
94+
begin
95+
FileUtils.remove_entry_secure checkout_dir
96+
rescue Errno::ENOTEMPTY, Errno::ENOENT => exc
97+
logger.debug "cleanup_checkout_dir(#{checkout_dir}) logged #{exc.class} - this can be ignored"
98+
end
9399
end
94100

95101
# Private method: Bootstrap a directory

0 commit comments

Comments
 (0)