Skip to content

Commit

Permalink
Demo mode minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
drsound committed Mar 15, 2015
1 parent b94e58f commit 17db354
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions lib/fault_tolerant_router/monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ def command(c)
def ping(ip, source)
if DEMO
sleep 0.1
#todo: should be easier a link is up
rand(2) == 0
rand(3) > 0
else
`ping -n -c 1 -W 2 -I #{source} #{ip}`
$?.to_i == 0
Expand Down Expand Up @@ -172,8 +171,12 @@ def monitor
end
end

puts "Waiting #{TEST_INTERVAL} seconds..." if DEBUG
#todo: sleep less seconds if in demo mode
sleep TEST_INTERVAL
if DEMO
puts "Waiting just 5 seconds because we are in demo mode, otherwise would wait #{TEST_INTERVAL} seconds..."
sleep 5
else
puts "Waiting #{TEST_INTERVAL} seconds..." if DEBUG
sleep TEST_INTERVAL
end
end
end
2 changes: 1 addition & 1 deletion lib/fault_tolerant_router/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module FaultTolerantRouter
VERSION = '0.9.9'
VERSION = '1.0.0'
end

0 comments on commit 17db354

Please sign in to comment.