diff options
author | Frédéric Guillot <fred@miniflux.net> | 2019-07-26 21:13:06 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2019-07-26 21:24:15 -0700 |
commit | 3d19313a7f655bc2626990650c4de8141485eea3 (patch) | |
tree | c7fb0ade2b0f2eac2ae42067342df2e584ad230d /storage/job.go | |
parent | 17aae725830cdd27131d40e20f3901d7da25e281 (diff) |
Add option to disable feeds
Diffstat (limited to 'storage/job.go')
-rw-r--r-- | storage/job.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/storage/job.go b/storage/job.go index e115533..c231c97 100644 --- a/storage/job.go +++ b/storage/job.go @@ -18,8 +18,9 @@ func (s *Storage) NewBatch(batchSize int) (jobs model.JobList, err error) { SELECT id, user_id FROM feeds - WHERE parsing_error_count < $1 - ORDER BY checked_at ASC LIMIT %d` + WHERE parsing_error_count < $1 AND disabled is false + ORDER BY checked_at ASC LIMIT %d + ` return s.fetchBatchRows(fmt.Sprintf(query, batchSize), maxParsingError) } @@ -32,8 +33,9 @@ func (s *Storage) NewUserBatch(userID int64, batchSize int) (jobs model.JobList, SELECT id, user_id FROM feeds - WHERE user_id=$1 - ORDER BY checked_at ASC LIMIT %d` + WHERE user_id=$1 AND disabled is false + ORDER BY checked_at ASC LIMIT %d + ` return s.fetchBatchRows(fmt.Sprintf(query, batchSize), userID) } |