Rename db to fdb

This commit is contained in:
Balakrishnan Balasubramanian 2022-06-17 17:06:45 -04:00
parent 27bea0c91b
commit 87990aa922

View File

@ -63,7 +63,7 @@ func ProcessFeed(feed *FeedCfg, scheduler schedule.Scheduler, dbDir string, tgra
return
}
db, err := NewDB(dbDir, feed.Name)
fdb, err := NewDB(dbDir, feed.Name)
if err != nil {
log.Error("failed to get db", "feed", feed.Name, "db_dir", dbDir, "error", err)
return
@ -102,7 +102,7 @@ func ProcessFeed(feed *FeedCfg, scheduler schedule.Scheduler, dbDir string, tgra
var records []Record
var newEntries []parser.FeedEntry
if db.IsNewFeed() {
if fdb.IsNewFeed() {
stat.New = stat.Total
ftl := int(feed.FirstTimeLimit)
if feed.FirstTimeLimit == NoLimit || len(entries) <= ftl {
@ -121,7 +121,7 @@ func ProcessFeed(feed *FeedCfg, scheduler schedule.Scheduler, dbDir string, tgra
stat.Filtered = len(filteredEntries)
}
} else {
newEntries, err = db.Filter(entries)
newEntries, err = fdb.Filter(entries)
if err != nil {
log.Error("failed to filter entries", "feed", feed.Name, "error", err)
return
@ -144,7 +144,7 @@ func ProcessFeed(feed *FeedCfg, scheduler schedule.Scheduler, dbDir string, tgra
}
records = append(records, r)
}
err = db.Save(records)
err = fdb.Save(records)
if err != nil {
log.Error("failed to save sent records", "feed", feed.Name, "num_records", len(records), "error", err)
}