Beispiel #1
0
 internal MemCache()
 {
     if (string.IsNullOrEmpty(AppConfig.Cache.MemCacheServers))
     {
         Error.Throw("AppConfig.Cache.MemCacheServers cant' be Empty!");
     }
     client = MemcachedClient.Create(AppConfig.Cache.MemCacheServers);
     if (client.hostServer.HostList.Count == 0)
     {
         Error.Throw("AppConfig.Cache.MemCacheServers can't find the host for service : " + AppConfig.Cache.MemCacheServers);
     }
     if (!string.IsNullOrEmpty(AppConfig.Cache.MemCacheServersBak))
     {
         MemcachedClient clientBak = MemcachedClient.Create(AppConfig.Cache.MemCacheServersBak);
         client.hostServer.hostServerBak = clientBak.hostServer;
     }
 }
Beispiel #2
0
 internal MemCache()
 {
     if (string.IsNullOrEmpty(AppConfig.Cache.MemCacheServers))
     {
         string err = "AppConfig.Cache.MemCacheServers cant' be Empty!";
         Log.WriteLogToTxt(err, LogType.Cache);
         Error.Throw(err);
     }
     client = MemcachedClient.Create(AppConfig.Cache.MemCacheServers);
     if (client.hostServer.HostList.Count == 0)
     {
         string err = "AppConfig.Cache.MemCacheServers can't find the host for service : " + AppConfig.Cache.MemCacheServers;
         Log.WriteLogToTxt(err, LogType.Cache);
         Error.Throw(err);
     }
     if (!string.IsNullOrEmpty(AppConfig.Cache.MemCacheServersBak))
     {
         MemcachedClient clientBak = MemcachedClient.Create(AppConfig.Cache.MemCacheServersBak);
         client.hostServer.hostServerBak = clientBak.hostServer;
     }
 }