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
bebced8f
Commit
bebced8f
authored
Feb 06, 2018
by
Stuart Nelson
Committed by
Sean McGivern
Mar 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
creating background job
parent
391732a2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
0 deletions
+27
-0
app/services/issues/base_service.rb
app/services/issues/base_service.rb
+6
-0
app/services/issues/create_service.rb
app/services/issues/create_service.rb
+2
-0
app/services/issues/update_service.rb
app/services/issues/update_service.rb
+7
-0
app/workers/all_queues.yml
app/workers/all_queues.yml
+1
-0
app/workers/issue_due_worker.rb
app/workers/issue_due_worker.rb
+11
-0
No files found.
app/services/issues/base_service.rb
View file @
bebced8f
...
@@ -7,6 +7,12 @@ module Issues
...
@@ -7,6 +7,12 @@ module Issues
hook_data
hook_data
end
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
def
reopen_service
Issues
::
ReopenService
Issues
::
ReopenService
end
end
...
...
app/services/issues/create_service.rb
View file @
bebced8f
...
@@ -27,6 +27,8 @@ module Issues
...
@@ -27,6 +27,8 @@ module Issues
todo_service
.
new_issue
(
issuable
,
current_user
)
todo_service
.
new_issue
(
issuable
,
current_user
)
user_agent_detail_service
.
create
user_agent_detail_service
.
create
resolve_discussions_with_issue
(
issuable
)
resolve_discussions_with_issue
(
issuable
)
# TODO: Create the scheduled due date email
schedule_due_date_email
(
issuable
)
super
super
end
end
...
...
app/services/issues/update_service.rb
View file @
bebced8f
...
@@ -13,6 +13,10 @@ module Issues
...
@@ -13,6 +13,10 @@ module Issues
spam_check
(
issue
,
current_user
)
spam_check
(
issue
,
current_user
)
end
end
def
after_update
(
issue
)
schedule_due_date_email
(
issue
)
end
def
handle_changes
(
issue
,
options
)
def
handle_changes
(
issue
,
options
)
old_associations
=
options
.
fetch
(
:old_associations
,
{})
old_associations
=
options
.
fetch
(
:old_associations
,
{})
old_labels
=
old_associations
.
fetch
(
:labels
,
[])
old_labels
=
old_associations
.
fetch
(
:labels
,
[])
...
@@ -23,6 +27,9 @@ module Issues
...
@@ -23,6 +27,9 @@ module Issues
todo_service
.
mark_pending_todos_as_done
(
issue
,
current_user
)
todo_service
.
mark_pending_todos_as_done
(
issue
,
current_user
)
end
end
# TODO: If due date doesn't change, don't bother updating the due date
# email worker
if
issue
.
previous_changes
.
include?
(
'title'
)
||
if
issue
.
previous_changes
.
include?
(
'title'
)
||
issue
.
previous_changes
.
include?
(
'description'
)
issue
.
previous_changes
.
include?
(
'description'
)
todo_service
.
update_issue
(
issue
,
current_user
,
old_mentioned_users
)
todo_service
.
update_issue
(
issue
,
current_user
,
old_mentioned_users
)
...
...
app/workers/all_queues.yml
View file @
bebced8f
...
@@ -78,6 +78,7 @@
...
@@ -78,6 +78,7 @@
-
group_destroy
-
group_destroy
-
invalid_gpg_signature_update
-
invalid_gpg_signature_update
-
irker
-
irker
-
issue_due
-
merge
-
merge
-
namespaceless_project_destroy
-
namespaceless_project_destroy
-
new_issue
-
new_issue
...
...
app/workers/issue_due_worker.rb
0 → 100644
View file @
bebced8f
class
IssueDueWorker
include
ApplicationWorker
def
perform
(
issue_id
)
issue
=
Issue
.
find_by_id
(
issue_id
)
# How do we want to deal with noops?
if
issue
.
due_date
==
Date
.
today
# execute
end
end
end
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