Exemple #1
0
 public static void Stop()
 {
     lock (_sync)
     {
         HttpRuntime.Cache.Remove(instance._cacheKey);
         instance = null;
     }
 }
Exemple #2
0
 private KeepAlive(string applicationUrl, bool addRandom, 
     Action<DateTime> customAction, Action<Exception> exceptionHandler)
 {
     _applicationUrl = applicationUrl;
     _addRandom = addRandom;
     _customAction = customAction;
     _exceptionHandler = exceptionHandler;
     _cacheKey = Guid.NewGuid().ToString();
     instance = this;
 }
Exemple #3
0
 public static void Start(string applicationUrl, bool addRandom, 
     Action<DateTime> customAction, Action<Exception> exceptionHandler)
 {
     if (IsKeepingAlive)
     {
         return;
     }
     lock (_sync)
     {
         if (instance == null)
         {
             instance = new KeepAlive(applicationUrl, addRandom,
                 customAction, exceptionHandler);
             instance.Insert();
         }
     }
 }