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

Avoid excessive manual polling with default scheduler

This commit is contained in:
Frédéric Guillot 2023-10-16 21:20:58 -07:00
parent 54eb500315
commit cc44d14722
7 changed files with 40 additions and 15 deletions

View file

@ -38,7 +38,7 @@ func (s *Storage) NewUserBatch(userID int64, batchSize int) (jobs model.JobList,
FROM
feeds
WHERE
user_id=$1 AND disabled is false
user_id=$1 AND disabled is false AND next_check_at < now()
ORDER BY next_check_at ASC LIMIT %d
`
return s.fetchBatchRows(fmt.Sprintf(query, batchSize), userID)
@ -55,7 +55,7 @@ func (s *Storage) NewCategoryBatch(userID int64, categoryID int64, batchSize int
FROM
feeds
WHERE
user_id=$1 AND category_id=$2 AND disabled is false
user_id=$1 AND category_id=$2 AND disabled is false AND next_check_at < now()
ORDER BY next_check_at ASC LIMIT %d
`
return s.fetchBatchRows(fmt.Sprintf(query, batchSize), userID, categoryID)