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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
ab650e7c
Commit
ab650e7c
authored
Apr 17, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `bulk_perform_async` to schedule issue due emails
parent
fd4a0820
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
app/workers/issue_due_scheduler_worker.rb
app/workers/issue_due_scheduler_worker.rb
+3
-3
spec/workers/issue_due_scheduler_worker_spec.rb
spec/workers/issue_due_scheduler_worker_spec.rb
+1
-2
No files found.
app/workers/issue_due_scheduler_worker.rb
View file @
ab650e7c
...
@@ -3,8 +3,8 @@ class IssueDueSchedulerWorker
...
@@ -3,8 +3,8 @@ class IssueDueSchedulerWorker
include
CronjobQueue
include
CronjobQueue
def
perform
def
perform
Issue
.
opened
.
due_tomorrow
.
group
(
:project_id
).
pluck
(
:project_id
).
each
do
|
project_id
|
project_ids
=
Issue
.
opened
.
due_tomorrow
.
group
(
:project_id
).
pluck
(
:project_id
).
map
{
|
id
|
[
id
]
}
MailScheduler
::
IssueDueWorker
.
perform_async
(
project_id
)
end
MailScheduler
::
IssueDueWorker
.
bulk_perform_async
(
project_ids
)
end
end
end
end
spec/workers/issue_due_scheduler_worker_spec.rb
View file @
ab650e7c
...
@@ -14,8 +14,7 @@ describe IssueDueSchedulerWorker do
...
@@ -14,8 +14,7 @@ describe IssueDueSchedulerWorker do
create
(
:issue
,
:closed
,
project:
project_closed_issue
,
due_date:
Date
.
tomorrow
)
create
(
:issue
,
:closed
,
project:
project_closed_issue
,
due_date:
Date
.
tomorrow
)
create
(
:issue
,
:opened
,
project:
project_issue_due_another_day
,
due_date:
Date
.
today
)
create
(
:issue
,
:opened
,
project:
project_issue_due_another_day
,
due_date:
Date
.
today
)
expect
(
MailScheduler
::
IssueDueWorker
).
to
receive
(
:perform_async
).
with
(
project1
.
id
)
expect
(
MailScheduler
::
IssueDueWorker
).
to
receive
(
:bulk_perform_async
).
with
([[
project1
.
id
],
[
project2
.
id
]])
expect
(
MailScheduler
::
IssueDueWorker
).
to
receive
(
:perform_async
).
with
(
project2
.
id
)
described_class
.
new
.
perform
described_class
.
new
.
perform
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