1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Reformat's ArchiveEntries's query for consistency's sake

And replace the `=ANY` with an `IN`
This commit is contained in:
jvoisin 2024-02-25 17:00:52 +01:00 committed by Frédéric Guillot
parent 26d189917e
commit 66e0eb1bd6

View file

@ -230,12 +230,12 @@ func (s *Storage) GetReadTime(entry *model.Entry, feed *model.Feed) int {
var result int var result int
s.db.QueryRow( s.db.QueryRow(
`SELECT `SELECT
reading_time reading_time
FROM FROM
entries entries
WHERE WHERE
user_id=$1 AND user_id=$1 AND
feed_id=$2 AND feed_id=$2 AND
hash=$3 hash=$3
`, `,
feed.UserID, feed.UserID,
@ -333,7 +333,19 @@ func (s *Storage) ArchiveEntries(status string, days, limit int) (int64, error)
SET SET
status=$1 status=$1
WHERE WHERE
id=ANY(SELECT id FROM entries WHERE status=$2 AND starred is false AND share_code='' AND created_at < now () - '%d days'::interval ORDER BY created_at ASC LIMIT %d) id IN (
SELECT
id
FROM
entries
WHERE
status=$2 AND
starred is false AND
share_code='' AND
created_at < now () - '%d days'::interval
ORDER BY
created_at ASC LIMIT %d
)
` `
result, err := s.db.Exec(fmt.Sprintf(query, days, limit), model.EntryStatusRemoved, status) result, err := s.db.Exec(fmt.Sprintf(query, days, limit), model.EntryStatusRemoved, status)