@@ -177,19 +177,24 @@ handle_cast({unsubscribe, Pid, Key}, State) ->
177177% %--------------------------------------------------------------------
178178handle_info ({gproc , unreg , _Ref , Name }, State ) ->
179179 ets :delete (? TAB , {m , Name }),
180- notify (Name , undefined ),
181180 do_monitor (Name , undefined ),
181+ notify (Name , undefined ),
182182 {noreply , State };
183183handle_info ({gproc , {migrated ,ToPid }, _Ref , Name }, State ) ->
184184 ets :delete (? TAB , {m , Name }),
185+ do_monitor (Name , ToPid ),
185186 notify (Name , {migrated , ToPid }),
187+ {noreply , State };
188+ handle_info ({gproc , {failover ,ToPid }, _Ref , Name }, State ) ->
189+ ets :delete (? TAB , {m , Name }),
186190 do_monitor (Name , ToPid ),
191+ notify (Name , {failover , ToPid }),
187192 {noreply , State };
188193handle_info ({gproc , _ , registered , {{T ,_ ,_ } = Name , Pid , _ }}, State )
189194 when T == n ; T == a ->
190195 ets :delete (? TAB , {w , Name }),
191- notify (Name , Pid ),
192196 do_monitor (Name , Pid ),
197+ notify (Name , Pid ),
193198 {noreply , State };
194199handle_info ({'DOWN' , _ , process , Pid , _ }, State ) ->
195200 pid_is_down (Pid ),
@@ -239,7 +244,9 @@ do_monitor(Name, undefined) ->
239244 case ets :member (? TAB , {w , Name }) of
240245 false ->
241246 Ref = gproc :nb_wait (Name ),
242- ets :insert (? TAB , {{w , Name }, Ref })
247+ ets :insert (? TAB , {{w , Name }, Ref });
248+ true ->
249+ ok
243250 end ;
244251do_monitor (Name , Pid ) when is_pid (Pid ) ->
245252 case ets :member (? TAB , {m , Name }) of
0 commit comments