public object Load(IProgressIndicator progress, bool enablePersistence) { if (!enablePersistence || _cacheFormatVersion < 0) { return(null); } Assertion.Assert(_persistentCache == null, "persistentCache == null"); _persistentCache = new SimplePersistentCache <TCacheData>( _shellLocks, _cacheFormatVersion, _cacheName, _psiConfiguration); if (_persistentCache.Load(progress, _persistentIndexManager, ReadData, Merge) != LoadResult.OK) { lock (_lockObject) { ClearCache(); return(null); } } // Any returned value will be passed to MergeLoaded, but we've already // merged as part of the load above return(null); }
object ICache.Load(IProgressIndicator progress, bool enablePersistence) { if (enablePersistence) { _persistentCache = new SimplePersistentCache <string>(_shellLocks, 1, "KarmaTest", _psiConfiguration); if (_persistentCache.Load(progress, _persistentIndexManager, (file, reader) => reader.ReadString(), (file, serialized) => { lock (_lock) { var info = new PersistentUnitTestSessionInfo(_solution, serialized); foreach (var element in info.Elements) { _elementsInFiles.AddValue(file, element); } _processedFiles.Add(file); _persistentCache.AddDataToSave(file, serialized); } }) != LoadResult.OK) { lock (_lock) { _elementsInFiles.Clear(); _processedFiles.Clear(); } } } return(null); }
object ICache.Load(IProgressIndicator progress, bool enablePersistence) { if (enablePersistence) { _persistentCache = new SimplePersistentCache<string>(_shellLocks, 1, "KarmaTest", _psiConfiguration); if (_persistentCache.Load(progress, _persistentIndexManager, (file, reader) => reader.ReadString(), (file, serialized) => { lock (_lock) { var info = new PersistentUnitTestSessionInfo(_solution, serialized); foreach (var element in info.Elements) { _elementsInFiles.AddValue(file, element); } _processedFiles.Add(file); _persistentCache.AddDataToSave(file, serialized); } }) != LoadResult.OK) { lock (_lock) { _elementsInFiles.Clear(); _processedFiles.Clear(); } } } return null; }