示例#1
0
        public ImmutableDictionary <string, T> GetAll()
        {
            if (DateTime.Now.Date != LastEagerUpdate.Date || DateTime.Now.Hour - LastEagerUpdate.Hour >= HourDiffrenceForUpdatingCache)
            {
                populateCache();
            }

            r_ReadWritelock.AcquireReaderLock(Timeout.Infinite);
            var res = m_CachedData.ToImmutableDictionary();

            r_ReadWritelock.ReleaseReaderLock();
            Event_GetAllCompleted?.Invoke(this, new EventArgs());

            return(res);
        }
示例#2
0
 public void ForceCacheUpdate()
 {
     populateCache();
     Event_GetAllCompleted?.Invoke(this, new EventArgs());
 }