public IEnumerable <uSyncAction> ImportAll(string folder, HandlerSettings config, bool force, SyncUpdateCallback callback = null) { var sw = Stopwatch.StartNew(); logger.Debug(handlerType, "{alias} ImportAll: {fileName}", this.Alias, Path.GetFileName(folder)); var actions = new List <uSyncAction>(); var updates = new Dictionary <string, TObject>(); runtimeCache.ClearByKey($"keycache_{this.Alias}"); actions.AddRange(ImportFolder(folder, config, updates, force, callback)); if (updates.Any()) { ProcessSecondPasses(updates, actions, config, callback); } runtimeCache.ClearByKey($"keycache_{this.Alias}"); callback?.Invoke("Done", 3, 3); sw.Stop(); logger.Debug(handlerType, "{alias} Import Complete {elapsedMilliseconds}ms", this.Alias, sw.ElapsedMilliseconds); return(actions); }
/// <summary> /// Clears all caches related to the SPA. /// </summary> public void ClearAll() { // Change the content GUID so the frontend knows the content has been updated SpaEnvironment.ContentGuid = Guid.NewGuid(); // Clear the micro cache _runtimeCache.ClearByKey(SpaConstants.CachePrefix); }
private void RecycleCache() { // Clear cache _runtimeCache.ClearByKey(Settings.CacheKey); // Rebuild cache GetIcons(); }
public List <DtgeManifest> GetAllCachedManifests(bool purgeCache = false) { if (purgeCache) { _cache.ClearByKey("skttlDtgeTreeManifests"); } return(_cache.GetCacheItem <List <DtgeManifest> >("skttlDtgeTreeManifests", () => GetAllManifests(), new TimeSpan(1, 0, 0))); }
public void ClearByKeyPrefix(string keyPrefix) { _cache.ClearByKey(keyPrefix); }