lib/bolt_server/file_cache.rb in bolt-1.5.0 vs lib/bolt_server/file_cache.rb in bolt-1.6.0
- old
+ new
@@ -164,10 +164,10 @@
def expire(purge_ttl)
expired_time = Time.now - purge_ttl
@cache_dir_mutex.with_write_lock do
Dir.glob(File.join(@cache_dir, '*')).select { |f| File.directory?(f) }.each do |dir|
- if (mtime = File.mtime(dir)) < expired_time
+ if (mtime = File.mtime(dir)) < expired_time && dir != tmppath
@logger.debug("Removing #{dir}, last used at #{mtime}")
FileUtils.remove_dir(dir)
end
end
end