Пример #1
0
 public RedmineServiceEndpoint(string name, string url, string apiKey)
 {
     _name = name;
     _url = url;
     _apiKey = apiKey;
     _context = new GCCache<RedmineServiceContext>(
         () => new RedmineServiceContext(new Uri(_url), _apiKey));
 }
Пример #2
0
 public RedmineServiceEndpoint(string name, string url, string apiKey)
 {
     _name    = name;
     _url     = url;
     _apiKey  = apiKey;
     _context = new GCCache <RedmineServiceContext>(
         () => new RedmineServiceContext(new Uri(_url), _apiKey));
 }
Пример #3
0
        private static bool HandleGarbage()
        {
            if (AutoGCMode)
            {
                if (GCCache == null)
                {
                    GCCache = new List <DateTime>();
                }

                if (GCCache.Count > 0 && DateTime.UtcNow - GCCache.Last() > GCDelay)
                {
                    ClearIgnoreList();
                    return(true);
                }
            }
            return(false);
        }
Пример #4
0
        /// <summary>
        /// Adds multiple object ID´s to ignore list.
        /// </summary>
        /// <param name="list"></param>
        public static void Ignore(List <uint> list)
        {
            HandleGarbage();
            foreach (var e in list)
            {
                Stealth.Client.Ignore(e);
            }
#if DEBUG
            ScriptLogger.WriteLine(string.Format("Adding {0} Items to Client Cache", list.Count));
#endif
            if (AutoGCMode)
            {
                if (GCCache == null)
                {
                    GCCache = new List <DateTime>();
                }

                var now = DateTime.UtcNow;
#if DEBUG
                ScriptLogger.WriteLine(string.Format("{0} New Items Cached  => {1}", list.Count, now));
#endif
                GCCache.Add(now);
            }
        }