Skip to content

Commit

Permalink
Merge pull request #53 from southbridgeio/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
vladislav-yashin authored Jun 29, 2021
2 parents ef3fc49 + 2cb8b19 commit fc70aeb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 3.0.2 / 2020-06-29

* Rescue exceptions in update manager thread

### 3.0.1 / 2020-06-29

* Fix client dispose
Expand Down
4 changes: 3 additions & 1 deletion lib/tdlib/update_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def add_handler(handler)

def run(callback: nil)
Thread.start do
catch(:client_closed) { loop { handle_update(callback: callback) } }
catch(:client_closed) { loop { handle_update(callback: callback); sleep 0.001 } }
@mutex.synchronize { @handlers = [] }
end
end
Expand All @@ -34,6 +34,8 @@ def handle_update(callback: nil)

match_handlers!(update, extra).each { |h| h.async.run(update) }
end
rescue StandardError => e
warn("Uncaught exception in update manager: #{e.message}")
end

def match_handlers!(update, extra)
Expand Down
2 changes: 1 addition & 1 deletion lib/tdlib/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module TD
# tdlib-ruby version
VERSION = "3.0.1"
VERSION = "3.0.2"
end

0 comments on commit fc70aeb

Please sign in to comment.