/// <summary> /// Returns the most recent appended collection /// </summary> async Task <FileListItem> LatestFile() { var files = (await Store.List(Path).SelectManyList()).Where(p => !p.Path.Name.StartsWith("_")); var latest = files.OrderByDescending(f => StoreFileMd.GetTs(f.Path)).FirstOrDefault(); return(latest); }
public async Task Append(IReadOnlyCollection <T> items) { var ts = items.Max(GetTs); var path = StoreFileMd.FilePath(Path, ts, Version); await using var memStream = items.ToJsonlGzStream(); var res = await Store.Save(path, memStream).WithDuration(); Log.Debug("Store - Saved '{Path}' in {Duration}", path, res); }
public async Task <StoreFileMd> LatestFileMetadata() { var file = await LatestFile(); return(file == null ? null : StoreFileMd.FromFileItem(file)); }