public override void ClearLock(string name) { lock (_locks) { if (_locks.ContainsKey(name)) { _locks[name].BreakLock(); } } _cacheDirectory.ClearLock(name); }
/// <summary> /// 索引库数量 /// </summary> /// <returns></returns> public int Count() { try { IndexReader reader = DirectoryReader.Open(_directory); return(reader.NumDocs); } catch (IndexNotFoundException ex) { _directory.ClearLock("write.lock"); Console.WriteLine(ex.Message); return(0); } }
public override void ClearLock(string name) { _primaryDirectory.ClearLock(name); _cacheDirectory.ClearLock(name); }