summaryrefslogtreecommitdiffstats
path: root/feed/feed.go
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2021-11-28 23:34:15 -0500
committersiddharth <s@ricketyspace.net>2021-11-28 23:34:15 -0500
commitc78ce3ff4e7d5d1dfc79baaae646b9d2e3a55fee (patch)
tree401a2e9e803bba1b74989f75235b69b2ba44f900 /feed/feed.go
parent7d65a623291221f097af12bfd3c2994550d776f6 (diff)
feed: fix Validate
Don't set YDLPath and DumpDir on Feed in `Validate` function. Set it in the FeedConfig's `validate` function instead.
Diffstat (limited to 'feed/feed.go')
-rw-r--r--feed/feed.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/feed/feed.go b/feed/feed.go
index e306bef..25fc97d 100644
--- a/feed/feed.go
+++ b/feed/feed.go
@@ -26,12 +26,8 @@ type Feed struct {
Entries []schema.Entry
}
-func (feed *Feed) Validate(ydlPath, baseDumpDir string) error {
- _, err := os.Stat(ydlPath)
- if err != nil {
- return err
- }
- _, err = os.Stat(baseDumpDir)
+func (feed *Feed) Validate(baseDumpDir string) error {
+ _, err := os.Stat(baseDumpDir)
if err != nil {
return err
}
@@ -63,9 +59,6 @@ func (feed *Feed) Validate(ydlPath, baseDumpDir string) error {
return fmt.Errorf("'last' not set or 0 in a feed '%s'", feed.Id)
}
- // Set ydl-path for feed.
- feed.YDLPath = ydlPath
-
// Set dump directory for feed and ensure it exists.
feed.DumpDir = path.Join(baseDumpDir, feed.Id)
err = os.MkdirAll(feed.DumpDir, 0755)