Skip to content

Commit

Permalink
acu66553 fix for not cleaning temp basedir in case of exception; temp…
Browse files Browse the repository at this point in the history
… means temp
  • Loading branch information
smessier committed Dec 7, 2012
1 parent 35e7787 commit a9c3453
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/right_scraper/scraper.rb
Expand Up @@ -95,12 +95,12 @@ def scrape(repo, incremental=true, &callback)
@resources += scraper.scrape
end
end

# 3. Cleanup if temporary
FileUtils.remove_entry_secure(@options[:basedir]) if @temporary
rescue Exception
# logger handles communication with the end user and appending
# to our error list, we just need to keep going.
ensure
# ensure basedir is always removed if temporary (even with errors).
::FileUtils.remove_entry_secure(@options[:basedir]) rescue nil if @temporary
end
@logger.callback = nil
errors.size == errorlen
Expand Down

0 comments on commit a9c3453

Please sign in to comment.