aboutsummaryrefslogtreecommitdiffhomepage
path: root/storage/job.go
diff options
context:
space:
mode:
Diffstat (limited to 'storage/job.go')
-rw-r--r--storage/job.go10
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)
}