anchor.diff:  
   code_change(_OldVsn, St, _Extra) ->
       {ok, St}.
  -
  -
  -watchdog() ->
  -    timer:sleep(300000),
  -    Handlers = gen_event:which_handlers(couch_db_update),
  -    case length(Handlers) > 0 of
  -        true ->
  -            supervisor:terminate_child(
  -                    couch_primary_services, couch_db_update_event),
  -            supervisor:restart_child(
  -                    couch_primary_services, couch_db_update_event);
  -        false ->
  -            ok
  -    end,
  -    ?MODULE:watchdog().
   
   
   notify_listeners(ByDbName, DbName, Event) ->
  
positive.code:     {noreply, St};
  
  
  handle_info(spawn_watchdog, #st{watchdog=undefined}=St) ->
      NewWD = spawn_monitor(?MODULE, watchdog, []),
      {noreply, St#st{watchdog=NewWD}};
  handle_info(Msg, St) ->
      couch_log:notice("~s ignoring info ~w", [?MODULE, Msg]),
      {noreply, St}.
  
negative.code:     {ok, ByDbName} = khash:new(),
      {ok, #st{
          by_pid = ByPid,
          by_dbname = ByDbName
      }}.
  
  
  