Exemplo n.º 1
0
 private void RegisterToRSD()
 {
     using (var r = HostContext.AppHost.GetRedisClient())
     {
         using (var p = r.CreatePipeline())
         {
             RegisterTypes(p);
             RegisterNode(p);
             p.Flush();
         }
         if (CanHostMaster)
         {
             HandleHostMasterRole(r);
         }
         OnNodeRefreshActions.Each(a => a());
     }
 }
Exemplo n.º 2
0
 private void RegisterToRSD()
 {
     using (var r = HostContext.AppHost.GetRedisClient())
     {
         if (FirstNodeRegistration)
         {
             string lauScript = $@"local x = redis.call('smembers','{RedisNodeRefreshKeySet}') for _,key in ipairs(x) do redis.call('EXPIRE',key,ARGV[1]) end";
             RefreshScriptSHA1 = r.LoadLuaScript(lauScript);
         }
         using (var p = r.CreatePipeline())
         {
             RegisterTypes(p);
             RegisterNode(p);
             p.Flush();
         }
         if (CanHostMaster)
         {
             HandleHostMasterRole(r);
         }
         OnNodeRefreshActions.Each(a => a());
     }
 }