Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
9d81d5aa
Commit
9d81d5aa
authored
Feb 10, 2018
by
Stuart Nelson
Committed by
Sean McGivern
Mar 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use cron for sending emails
parent
ff830bc1
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
19 deletions
+8
-19
app/services/issues/base_service.rb
app/services/issues/base_service.rb
+0
-6
app/services/issues/create_service.rb
app/services/issues/create_service.rb
+0
-1
app/services/issues/update_service.rb
app/services/issues/update_service.rb
+0
-7
app/workers/all_queues.yml
app/workers/all_queues.yml
+1
-1
app/workers/issue_due_worker.rb
app/workers/issue_due_worker.rb
+3
-3
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+4
-0
config/sidekiq_queues.yml
config/sidekiq_queues.yml
+0
-1
No files found.
app/services/issues/base_service.rb
View file @
9d81d5aa
...
...
@@ -7,12 +7,6 @@ module Issues
hook_data
end
def
schedule_due_date_email
(
issuable
)
return
if
issuable
.
due_date
.
nil?
IssueDueWorker
.
perform_at
(
issuable
.
due_date
.
to_time
,
issuable
.
id
)
end
def
reopen_service
Issues
::
ReopenService
end
...
...
app/services/issues/create_service.rb
View file @
9d81d5aa
...
...
@@ -27,7 +27,6 @@ module Issues
todo_service
.
new_issue
(
issuable
,
current_user
)
user_agent_detail_service
.
create
resolve_discussions_with_issue
(
issuable
)
schedule_due_date_email
(
issuable
)
super
end
...
...
app/services/issues/update_service.rb
View file @
9d81d5aa
...
...
@@ -13,10 +13,6 @@ module Issues
spam_check
(
issue
,
current_user
)
end
def
after_update
(
issue
)
schedule_due_date_email
(
issue
)
end
def
handle_changes
(
issue
,
options
)
old_associations
=
options
.
fetch
(
:old_associations
,
{})
old_labels
=
old_associations
.
fetch
(
:labels
,
[])
...
...
@@ -27,9 +23,6 @@ module Issues
todo_service
.
mark_pending_todos_as_done
(
issue
,
current_user
)
end
# TODO: If due date doesn't change, don't bother updating the due date
# email worker
if
issue
.
previous_changes
.
include?
(
'title'
)
||
issue
.
previous_changes
.
include?
(
'description'
)
todo_service
.
update_issue
(
issue
,
current_user
,
old_mentioned_users
)
...
...
app/workers/all_queues.yml
View file @
9d81d5aa
...
...
@@ -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
...
...
app/workers/issue_due_worker.rb
View file @
9d81d5aa
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
...
...
config/initializers/1_settings.rb
View file @
9d81d5aa
...
...
@@ -431,6 +431,10 @@ Settings.cron_jobs['pages_domain_verification_cron_worker'] ||= Settingslogic.ne
Settings
.
cron_jobs
[
'pages_domain_verification_cron_worker'
][
'cron'
]
||=
'*/15 * * * *'
Settings
.
cron_jobs
[
'pages_domain_verification_cron_worker'
][
'job_class'
]
=
'PagesDomainVerificationCronWorker'
Settings
.
cron_jobs
[
'issue_due_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'issue_due_worker'
][
'cron'
]
||=
'50 00 * * *'
Settings
.
cron_jobs
[
'issue_due_worker'
][
'job_class'
]
=
'IssueDueWorker'
#
# GitLab Shell
#
...
...
config/sidekiq_queues.yml
View file @
9d81d5aa
...
...
@@ -48,7 +48,6 @@
- [authorized_projects, 1]
- [expire_build_instance_artifacts, 1]
- [group_destroy, 1]
- [issue_due, 1]
- [irker, 1]
- [namespaceless_project_destroy, 1]
- [project_cache, 1]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment