aboutsummaryrefslogtreecommitdiffhomepage
path: root/storage/feed.go
diff options
context:
space:
mode:
Diffstat (limited to 'storage/feed.go')
-rw-r--r--storage/feed.go17
1 files changed, 0 insertions, 17 deletions
diff --git a/storage/feed.go b/storage/feed.go
index 6d0684e..5c2df83 100644
--- a/storage/feed.go
+++ b/storage/feed.go
@@ -8,17 +8,13 @@ import (
"database/sql"
"errors"
"fmt"
- "time"
"miniflux.app/model"
- "miniflux.app/timer"
"miniflux.app/timezone"
)
// FeedExists checks if the given feed exists.
func (s *Storage) FeedExists(userID, feedID int64) bool {
- defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:FeedExists] userID=%d, feedID=%d", userID, feedID))
-
var result int
query := `SELECT count(*) as c FROM feeds WHERE user_id=$1 AND id=$2`
s.db.QueryRow(query, userID, feedID).Scan(&result)
@@ -27,8 +23,6 @@ func (s *Storage) FeedExists(userID, feedID int64) bool {
// FeedURLExists checks if feed URL already exists.
func (s *Storage) FeedURLExists(userID int64, feedURL string) bool {
- defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:FeedURLExists] userID=%d, feedURL=%s", userID, feedURL))
-
var result int
query := `SELECT count(*) as c FROM feeds WHERE user_id=$1 AND feed_url=$2`
s.db.QueryRow(query, userID, feedURL).Scan(&result)
@@ -59,8 +53,6 @@ func (s *Storage) CountErrorFeeds(userID int64) int {
// Feeds returns all feeds of the given user.
func (s *Storage) Feeds(userID int64) (model.Feeds, error) {
- defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:Feeds] userID=%d", userID))
-
feeds := make(model.Feeds, 0)
query := `SELECT
f.id, f.feed_url, f.site_url, f.title, f.etag_header, f.last_modified_header,
@@ -130,8 +122,6 @@ func (s *Storage) Feeds(userID int64) (model.Feeds, error) {
// FeedByID returns a feed by the ID.
func (s *Storage) FeedByID(userID, feedID int64) (*model.Feed, error) {
- defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:FeedByID] feedID=%d", feedID))
-
var feed model.Feed
var iconID interface{}
var tz string
@@ -193,7 +183,6 @@ func (s *Storage) FeedByID(userID, feedID int64) (*model.Feed, error) {
// CreateFeed creates a new feed.
func (s *Storage) CreateFeed(feed *model.Feed) error {
- defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:CreateFeed] feedURL=%s", feed.FeedURL))
sql := `
INSERT INTO feeds
(feed_url, site_url, title, category_id, user_id, etag_header, last_modified_header, crawler, user_agent, username, password)
@@ -233,8 +222,6 @@ func (s *Storage) CreateFeed(feed *model.Feed) error {
// UpdateFeed updates an existing feed.
func (s *Storage) UpdateFeed(feed *model.Feed) (err error) {
- defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:UpdateFeed] feedURL=%s", feed.FeedURL))
-
query := `UPDATE feeds SET
feed_url=$1, site_url=$2, title=$3, category_id=$4, etag_header=$5, last_modified_header=$6, checked_at=$7,
parsing_error_msg=$8, parsing_error_count=$9, scraper_rules=$10, rewrite_rules=$11, crawler=$12, user_agent=$13,
@@ -270,8 +257,6 @@ func (s *Storage) UpdateFeed(feed *model.Feed) (err error) {
// UpdateFeedError updates feed errors.
func (s *Storage) UpdateFeedError(feed *model.Feed) (err error) {
- defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:UpdateFeedError] feedID=%d", feed.ID))
-
query := `
UPDATE feeds
SET
@@ -297,8 +282,6 @@ func (s *Storage) UpdateFeedError(feed *model.Feed) (err error) {
// RemoveFeed removes a feed.
func (s *Storage) RemoveFeed(userID, feedID int64) error {
- defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:RemoveFeed] userID=%d, feedID=%d", userID, feedID))
-
result, err := s.db.Exec("DELETE FROM feeds WHERE id = $1 AND user_id = $2", feedID, userID)
if err != nil {
return fmt.Errorf("unable to remove feed #%d: %v", feedID, err)