From 87990aa9221c889b6d1d1a5ccdd1994d0da6218a Mon Sep 17 00:00:00 2001 From: balki <3070606-balki@users.noreply.gitlab.com> Date: Fri, 17 Jun 2022 17:06:45 -0400 Subject: [PATCH] Rename db to fdb --- app/app.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index 9385087..7c293a2 100644 --- a/app/app.go +++ b/app/app.go @@ -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) }