mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Use variables for the status in the entries table
This commit is contained in:
parent
2d167ae9f9
commit
65e2fddfb5
2 changed files with 6 additions and 6 deletions
|
@ -323,12 +323,12 @@ func (s *Storage) ArchiveEntries(status string, days, limit int) (int64, error)
|
|||
UPDATE
|
||||
entries
|
||||
SET
|
||||
status='removed'
|
||||
status=$1
|
||||
WHERE
|
||||
id=ANY(SELECT id FROM entries WHERE status=$1 AND starred is false AND share_code='' AND created_at < now () - '%d days'::interval ORDER BY created_at ASC LIMIT %d)
|
||||
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)
|
||||
`
|
||||
|
||||
result, err := s.db.Exec(fmt.Sprintf(query, days, limit), status)
|
||||
result, err := s.db.Exec(fmt.Sprintf(query, days, limit), model.EntryStatusRemoved, status)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf(`store: unable to archive %s entries: %v`, status, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue