diff --git a/incremental_ext_test.go b/incremental_ext_test.go index 25c0f0c..09cced3 100644 --- a/incremental_ext_test.go +++ b/incremental_ext_test.go @@ -1,38 +1,13 @@ package feedx import ( - "errors" "time" - - "github.com/bsm/bfs" ) func (p *IncrementalProducer) LoadManifest() (*Manifest, error) { - remote := bfs.NewObjectFromBucket(p.bucket, "manifest.json") - defer remote.Close() - - m := new(Manifest) - - r, err := NewReader(p.ctx, remote, nil) - if errors.Is(err, bfs.ErrNotFound) { - return m, nil - } else if err != nil { - return nil, err - } - defer r.Close() - - if err := r.Decode(m); errors.Is(err, bfs.ErrNotFound) { // some BFS implementations defer Open-ing the S3 object till first Decode call - return m, nil - } else if err != nil { - return nil, err - } - - return m, nil + return p.loadManifest() } func TimestampFromTime(t time.Time) timestamp { - if n := t.Unix()*1000 + int64(t.Nanosecond()/1e6); n > 0 { - return timestamp(n) - } - return 0 + return timestampFromTime(t) }