diff options
author | Adam Mathes <adam@trenchant.org> | 2018-04-22 20:20:38 -0700 |
---|---|---|
committer | Adam Mathes <adam@trenchant.org> | 2018-04-22 20:20:38 -0700 |
commit | 75db6ae83df1ef672f63340f05036e1c80f094b7 (patch) | |
tree | b77b500c030408ae979c88d3e537c00b0384acd4 | |
parent | 96345f2f23fa0ad42b181dd9d33b510532a77852 (diff) | |
download | neko-75db6ae83df1ef672f63340f05036e1c80f094b7.tar.gz neko-75db6ae83df1ef672f63340f05036e1c80f094b7.tar.bz2 neko-75db6ae83df1ef672f63340f05036e1c80f094b7.zip |
fix some performance issues because mysql is weird?
-rw-r--r-- | models/item/item.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/models/item/item.go b/models/item/item.go index b3dc5eb..4d3f455 100644 --- a/models/item/item.go +++ b/models/item/item.go @@ -117,7 +117,7 @@ func Filter(max_id int64, feed_id int64, category string, unread_only bool, star var args []interface{} - query := `SELECT item.id, item.title, item.url, item.description, + query := `SELECT item.id, item.feed_id, item.title, item.url, item.description, item.read_state, item.starred, item.publish_date, item.full_content, item.header_image, feed.url, feed.title, feed.category @@ -163,7 +163,8 @@ func Filter(max_id int64, feed_id int64, category string, unread_only bool, star items := make([]*Item, 0) for rows.Next() { i := new(Item) - err := rows.Scan(&i.Id, &i.Title, &i.Url, &i.Description, &i.ReadState, &i.Starred, &i.PublishDate, &i.FullContent, &i.HeaderImage, &i.FeedUrl, &i.FeedTitle, &i.FeedCategory) + var feed_id int64 + err := rows.Scan(&i.Id, &feed_id, &i.Title, &i.Url, &i.Description, &i.ReadState, &i.Starred, &i.PublishDate, &i.FullContent, &i.HeaderImage, &i.FeedUrl, &i.FeedTitle, &i.FeedCategory) if err != nil { log.Println(err) return nil, err |