diff options
author | elijah <elijah@riseup.net> | 2015-03-17 15:06:54 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2015-03-17 15:06:54 -0700 |
commit | 74a8f39a0d91f7f992c41cced01f80f24001e173 (patch) | |
tree | 2c459d89ed9d1e284098dc43715db813eab97f27 /lib/tapicero/loop.rb | |
parent | 2d42b4a39eaa346b94fa4aa2bb90bebb5621112e (diff) | |
parent | 25b34acce7612f58c5d40819de79734b08cdfb8f (diff) |
Merge branch 'develop' into version/0.6.1version/0.6.1
Conflicts:
Gemfile.lock
Diffstat (limited to 'lib/tapicero/loop.rb')
-rw-r--r-- | lib/tapicero/loop.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/tapicero/loop.rb b/lib/tapicero/loop.rb new file mode 100644 index 0000000..9c06e52 --- /dev/null +++ b/lib/tapicero/loop.rb @@ -0,0 +1,19 @@ +module Tapicero + class Loop + def listen(db_name) + loop do + begin + users = CouchRest::Changes.new(db_name) + UserEventHandler.new(users) + users.listen + Tapicero.logger.info('Lost contact with couchdb, will try again in 10 seconds') + sleep 10 + rescue SystemCallError => exc + Tapicero.logger.info('Problem connecting to couchdb (#{exc}). Will try again in 10 seconds.') + sleep 10 + retry + end + end + end + end +end |