Skip to content

Commit

Permalink
Merge pull request #4 from yaauie/retries
Browse files Browse the repository at this point in the history
add periodic timer to reduce the number of retries by 1 every 5 minutes
  • Loading branch information
dacort committed Nov 1, 2011
2 parents 3256026 + c28719a commit 9969410
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/firejab/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def run
puts "Fatal error with campfire, you'll need to restart"
end

EM::PeriodicTimer.new(300) do
self.campfire.reconnect_retries -= 1 unless self.campfire.reconnect_retries.zero?
end

EM::PeriodicTimer.new(1) do
check_jabber_connection

Expand Down

0 comments on commit 9969410

Please sign in to comment.