diff options
-rw-r--r-- | src/couchdb/couch_rep_db_listener.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/couchdb/couch_rep_db_listener.erl b/src/couchdb/couch_rep_db_listener.erl index bd47ac8f..6e9e6354 100644 --- a/src/couchdb/couch_rep_db_listener.erl +++ b/src/couchdb/couch_rep_db_listener.erl @@ -63,14 +63,14 @@ handle_cast(rep_db_changed, State) -> changes_feed_loop = Loop, changes_queue = Queue } = State, - unlink(Loop), + catch unlink(Loop), catch exit(Loop, rep_db_changed), couch_work_queue:queue(Queue, stop_all_replications), {ok, NewLoop} = changes_feed_loop(Queue), {noreply, State#state{changes_feed_loop = NewLoop}}; handle_cast(rep_db_created, #state{changes_feed_loop = Loop} = State) -> - unlink(Loop), + catch unlink(Loop), catch exit(Loop, rep_db_changed), {ok, NewLoop} = changes_feed_loop(State#state.changes_queue), {noreply, State#state{changes_feed_loop = NewLoop}}; @@ -79,6 +79,8 @@ handle_cast(Msg, State) -> ?LOG_ERROR("Replicator DB listener received unexpected cast ~p", [Msg]), {stop, {error, {unexpected_cast, Msg}}, State}. +handle_info({'EXIT', _OldChangesLoop, rep_db_changed}, State) -> + {noreply, State}; handle_info({'EXIT', From, normal}, #state{changes_feed_loop = From} = State) -> % replicator DB deleted |