summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--feed/feed.go6
1 files changed, 6 insertions, 0 deletions
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