anchor.diff:      [{Host,Port}].
   
   stop_all(RunMode) ->
  -    [exit(OldPid, kill)||OldPid<-application:get_env(message_store, {codis_scan_pid_list, RunMode}, [])],
  +    [begin
  +         application:unset_env(message_store, {codis_scan_result, RunMode, OldPid}),
  +         exit(OldPid, kill)
  +     end||OldPid<-application:get_env(message_store, {codis_scan_pid_list, RunMode}, [])],
  +    application:unset_env(message_store, {codis_scan_pid_list, RunMode}),
       ok.
   
   scan_worker(RedisHost, RedisPort, RunMode, RunArgs, MaxScan) ->
  
positive.code: 
  stop() ->
      stop_all(delete_bad_user_session).
      
  scan(Host, Port, CodisOrRedis, RunMode, RunArgs, MaxScan) ->
      stop_all(RunMode),
      ServerList = server_list(Host, Port, CodisOrRedis),
  
negative.code:         {ok, finish, List} ->
              do_handle(List, RunMode, RunArgs),
              ?INFO_MSG("Scan finish with finish:s=~p", [ {RedisHost,RedisPort}]),
              application:set_env(message_store, {codis_scan_result, RunMode, self()}, ok),
              ok;
          {ok, Next, List}->
              do_handle(List, RunMode, RunArgs),
              ?MODULE:do_scan(RedisHost, RedisPort, RunMode, RunArgs, Next, MaxScan-1);
          {error, Error} ->
              ?INFO_MSG("Scan finish with Error:~p,s=~p", [Error, {RedisHost,RedisPort}]),
              application:set_env(message_store, {codis_scan_result, RunMode, self()}, {error, Error}),
              {error, Error}
      end;
  do_scan(RedisHost, RedisPort, RunMode, _RunArgs, _Cursor, _MaxScan) ->
      ?INFO_MSG("Scan finish with :~p,s=~p", [max_scan, {RedisHost,RedisPort}]),
      application:set_env(message_store, {codis_scan_result, RunMode, self()}, ok),
      ok.
  
  
  