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); }
public void ForceCacheUpdate() { populateCache(); Event_GetAllCompleted?.Invoke(this, new EventArgs()); }