From feec7ac56e77fc3cc90e2f2b87032a3198004a83 Mon Sep 17 00:00:00 2001 From: siddharth Date: Sun, 28 Nov 2021 20:35:35 -0500 Subject: feed: add Feed.Last --- feed/feed.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/feed/feed.go b/feed/feed.go index e97921c..8d3609c 100644 --- a/feed/feed.go +++ b/feed/feed.go @@ -19,6 +19,7 @@ type Feed struct { Id string `json:"id"` Source string `json:"source"` Schema string `json:"schema"` + Last uint `json:"last"` YDLPath string DumpDir string Entries []schema.Entry @@ -56,6 +57,11 @@ func (feed *Feed) Validate(ydlPath, baseDumpDir string) error { feed.Schema, feed.Id) } + // Check 'last' + if feed.Last < 1 { + return fmt.Errorf("'last' not set or 0 in a feed '%s'", feed.Id) + } + // Set ydl-path for feed. feed.YDLPath = ydlPath -- cgit v1.2.3