diff options
Diffstat (limited to 'storage/icon.go')
-rw-r--r-- | storage/icon.go | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/storage/icon.go b/storage/icon.go index aa9f99e..7ad7d06 100644 --- a/storage/icon.go +++ b/storage/icon.go @@ -8,10 +8,8 @@ import ( "database/sql" "fmt" "strings" - "time" "miniflux.app/model" - "miniflux.app/timer" ) // HasIcon checks if the given feed has an icon. @@ -24,8 +22,6 @@ func (s *Storage) HasIcon(feedID int64) bool { // IconByID returns an icon by the ID. func (s *Storage) IconByID(iconID int64) (*model.Icon, error) { - defer timer.ExecutionTime(time.Now(), "[Storage:IconByID]") - var icon model.Icon query := `SELECT id, hash, mime_type, content FROM icons WHERE id=$1` err := s.db.QueryRow(query, iconID).Scan(&icon.ID, &icon.Hash, &icon.MimeType, &icon.Content) @@ -40,7 +36,6 @@ func (s *Storage) IconByID(iconID int64) (*model.Icon, error) { // IconByFeedID returns a feed icon. func (s *Storage) IconByFeedID(userID, feedID int64) (*model.Icon, error) { - defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:IconByFeedID] userID=%d, feedID=%d", userID, feedID)) query := ` SELECT icons.id, icons.hash, icons.mime_type, icons.content @@ -62,8 +57,6 @@ func (s *Storage) IconByFeedID(userID, feedID int64) (*model.Icon, error) { // IconByHash returns an icon by the hash (checksum). func (s *Storage) IconByHash(icon *model.Icon) error { - defer timer.ExecutionTime(time.Now(), "[Storage:IconByHash]") - err := s.db.QueryRow(`SELECT id FROM icons WHERE hash=$1`, icon.Hash).Scan(&icon.ID) if err == sql.ErrNoRows { return nil @@ -76,8 +69,6 @@ func (s *Storage) IconByHash(icon *model.Icon) error { // CreateIcon creates a new icon. func (s *Storage) CreateIcon(icon *model.Icon) error { - defer timer.ExecutionTime(time.Now(), "[Storage:CreateIcon]") - query := ` INSERT INTO icons (hash, mime_type, content) @@ -101,8 +92,6 @@ func (s *Storage) CreateIcon(icon *model.Icon) error { // CreateFeedIcon creates an icon and associate the icon to the given feed. func (s *Storage) CreateFeedIcon(feedID int64, icon *model.Icon) error { - defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:CreateFeedIcon] feedID=%d", feedID)) - err := s.IconByHash(icon) if err != nil { return err @@ -125,7 +114,6 @@ func (s *Storage) CreateFeedIcon(feedID int64, icon *model.Icon) error { // Icons returns all icons tht belongs to a user. func (s *Storage) Icons(userID int64) (model.Icons, error) { - defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:Icons] userID=%d", userID)) query := ` SELECT icons.id, icons.hash, icons.mime_type, icons.content |