Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add trap for ctrl-c
  • Loading branch information
changs committed Nov 28, 2011
1 parent 74eff9e commit c94ad77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crawler/crawler.rb
Expand Up @@ -9,6 +9,11 @@
require 'json'
require 'set'

trap("SIGINT") do
puts "Shuting down"
exit!
end

def meta_refresh?(page)
if redirect_url = page.doc.at('meta[http-equiv="Refresh"]')
else redirect_url = page.doc.at('meta[http-equiv="refresh"]')
Expand Down

0 comments on commit c94ad77

Please sign in to comment.