Navigation Menu

Skip to content

Commit

Permalink
fix wait_for_notify_defer crash on bad connection
Browse files Browse the repository at this point in the history
  • Loading branch information
royaltm committed May 24, 2014
1 parent 01883ac commit 8752f83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/pg/em.rb
Expand Up @@ -698,7 +698,12 @@ def #{defer_name}(*args, &blk)
def wait_for_notify_defer(timeout = nil, &blk)
df = FeaturedDeferrable.new
begin
setup_emio_watcher.watch_notifies(df, timeout)
check_async_command_aborted!
if status == CONNECTION_OK
setup_emio_watcher.watch_notify(df, timeout)
else
raise_error ConnectionBad
end
rescue Error => e
::EM.next_tick { async_autoreconnect!(df, e) }
rescue Exception => e
Expand Down

0 comments on commit 8752f83

Please sign in to comment.