diff options
author | 2023-10-16 21:20:58 -0700 | |
---|---|---|
committer | 2023-10-16 21:41:18 -0700 | |
commit | cc44d14722612d6a3db4360a971ac7cd0844b7ed (patch) | |
tree | bc8957460c5bbf91264ccd14fba499a5726ce32d /internal/storage/job.go | |
parent | 54eb500315c5f506004c4659a6c964f61d40f6d5 (diff) | |
download | v2-cc44d14722612d6a3db4360a971ac7cd0844b7ed.tar.gz v2-cc44d14722612d6a3db4360a971ac7cd0844b7ed.tar.zst v2-cc44d14722612d6a3db4360a971ac7cd0844b7ed.zip |
Avoid excessive manual polling with default scheduler
Diffstat (limited to 'internal/storage/job.go')
-rw-r--r-- | internal/storage/job.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/storage/job.go b/internal/storage/job.go index de3fdb32..a4b355a0 100644 --- a/internal/storage/job.go +++ b/internal/storage/job.go @@ -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) |