summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorStuart Nelson <stuartnelson3@gmail.com>2018-02-10 14:38:31 +0100
committerSean McGivern <sean@gitlab.com>2018-03-26 08:10:58 +0100
commit9d81d5aa893b20ebedcbdafc7d23d651d4dbee89 (patch)
tree5796ffe5a3e904f800593c2e59a7954bd08a4e88 /app/workers
parentff830bc1e17e574927893305c33c6e31955cd35a (diff)
downloadgitlab-ce-9d81d5aa893b20ebedcbdafc7d23d651d4dbee89.tar.gz
Use cron for sending emails
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/all_queues.yml2
-rw-r--r--app/workers/issue_due_worker.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index 93ad55fdd70..7598e579c26 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -18,6 +18,7 @@
- cronjob:stuck_import_jobs
- cronjob:stuck_merge_jobs
- cronjob:trending_projects
+- cronjob:issue_due
- gcp_cluster:cluster_install_app
- gcp_cluster:cluster_provision
@@ -78,7 +79,6 @@
- group_destroy
- invalid_gpg_signature_update
- irker
-- issue_due
- merge
- namespaceless_project_destroy
- new_issue
diff --git a/app/workers/issue_due_worker.rb b/app/workers/issue_due_worker.rb
index ddd61d7b912..90d2cc09f1b 100644
--- a/app/workers/issue_due_worker.rb
+++ b/app/workers/issue_due_worker.rb
@@ -1,9 +1,9 @@
class IssueDueWorker
include ApplicationWorker
+ include CronjobQueue
- def perform(issue_id)
- issue = Issue.find_by_id(issue_id)
- if issue.due_date == Date.today
+ def perform
+ Issue.where(due_date: Date.today).find_each do |issue|
NotificationService.new.issue_due_email(issue)
end
end