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
4f70eba6
Commit
4f70eba6
authored
Sep 21, 2020
by
Alex Buijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add member invitation reminder emails cron worker
Add worker configuration
parent
deb809c4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
0 deletions
+55
-0
app/workers/all_queues.yml
app/workers/all_queues.yml
+8
-0
app/workers/member_invitation_reminder_emails_worker.rb
app/workers/member_invitation_reminder_emails_worker.rb
+15
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+3
-0
spec/workers/member_invitation_reminder_emails_worker_spec.rb
.../workers/member_invitation_reminder_emails_worker_spec.rb
+29
-0
No files found.
app/workers/all_queues.yml
View file @
4f70eba6
...
...
@@ -211,6 +211,14 @@
:weight:
1
:idempotent:
:tags: []
-
:name: cronjob:member_invitation_reminder_emails
:feature_category: :subgroups
:has_external_dependencies:
:urgency: :low
:resource_boundary: :unknown
:weight:
1
:idempotent:
:tags: []
-
:name: cronjob:metrics_dashboard_schedule_annotations_prune
:feature_category: :metrics
:has_external_dependencies:
...
...
app/workers/member_invitation_reminder_emails_worker.rb
0 → 100644
View file @
4f70eba6
# frozen_string_literal: true
class
MemberInvitationReminderEmailsWorker
# rubocop:disable Scalability/IdempotentWorker
include
ApplicationWorker
include
CronjobQueue
# rubocop:disable Scalability/CronWorkerContext
feature_category
:subgroups
urgency
:low
def
perform
return
unless
Gitlab
::
Experimentation
.
enabled?
(
:invitation_reminders
)
# To keep this MR small, implementation will be done in another MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42981/diffs?commit_id=8063606e0f83957b2dd38d660ee986f24dee6138
end
end
config/initializers/1_settings.rb
View file @
4f70eba6
...
...
@@ -517,6 +517,9 @@ Settings.cron_jobs['ci_platform_metrics_update_cron_worker']['job_class'] = 'CiP
Settings
.
cron_jobs
[
'analytics_instance_statistics_count_job_trigger_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'analytics_instance_statistics_count_job_trigger_worker'
][
'cron'
]
||=
'50 23 */1 * *'
Settings
.
cron_jobs
[
'analytics_instance_statistics_count_job_trigger_worker'
][
'job_class'
]
||=
'Analytics::InstanceStatistics::CountJobTriggerWorker'
Settings
.
cron_jobs
[
'member_invitation_reminder_emails_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'member_invitation_reminder_emails_worker'
][
'cron'
]
||=
'0 0 * * *'
Settings
.
cron_jobs
[
'member_invitation_reminder_emails_worker'
][
'job_class'
]
=
'MemberInvitationReminderEmailsWorker'
Gitlab
.
ee
do
Settings
.
cron_jobs
[
'adjourned_group_deletion_worker'
]
||=
Settingslogic
.
new
({})
...
...
spec/workers/member_invitation_reminder_emails_worker_spec.rb
0 → 100644
View file @
4f70eba6
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
MemberInvitationReminderEmailsWorker
do
describe
'#perform'
do
subject
{
described_class
.
new
.
perform
}
context
'feature flag disabled'
do
before
do
stub_experiment
(
invitation_reminders:
false
)
end
it
'does not raise an error'
do
expect
{
subject
}.
not_to
raise_error
end
end
context
'feature flag enabled'
do
before
do
stub_experiment
(
invitation_reminders:
true
)
end
it
'does not raise an error'
do
expect
{
subject
}.
not_to
raise_error
end
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