public void SetChunk(IChunk chunk) { Primary.SetChunk(chunk); foreach (IChunkStorage storage in Secondary) { Task.Run(() => storage.SetChunk(chunk)); } }
public IChunk GetChunk(string hash) { IChunk chunk = Primary.GetChunk(hash); if (chunk != null) { return(chunk); } foreach (IChunkStorage storage in Secondary) { chunk = storage.GetChunk(hash); if (chunk != null) { Task.Run(() => Primary.SetChunk(chunk)); return(chunk); } } return(null); }