Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public async Task <StoreFileMd> LatestFileMetadata()
        {
            var file = await LatestFile();

            return(file == null ? null : StoreFileMd.FromFileItem(file));
        }