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
83643a99
Commit
83643a99
authored
Feb 01, 2021
by
Alex Buijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only schedule worker on GL.com
So it does not get scheduled on self-managed instances.
parent
bb19877a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
3 deletions
+30
-3
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+6
-3
lib/gitlab.rb
lib/gitlab.rb
+4
-0
spec/lib/gitlab_spec.rb
spec/lib/gitlab_spec.rb
+20
-0
No files found.
config/initializers/1_settings.rb
View file @
83643a99
...
...
@@ -544,9 +544,12 @@ Settings.cron_jobs['schedule_merge_request_cleanup_refs_worker']['job_class'] =
Settings
.
cron_jobs
[
'manage_evidence_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'manage_evidence_worker'
][
'cron'
]
||=
'0 * * * *'
Settings
.
cron_jobs
[
'manage_evidence_worker'
][
'job_class'
]
=
'Releases::ManageEvidenceWorker'
Settings
.
cron_jobs
[
'namespaces_in_product_marketing_emails_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'namespaces_in_product_marketing_emails_worker'
][
'cron'
]
||=
'0 9 * * *'
Settings
.
cron_jobs
[
'namespaces_in_product_marketing_emails_worker'
][
'job_class'
]
=
'Namespaces::InProductMarketingEmailsWorker'
Gitlab
.
com
do
Settings
.
cron_jobs
[
'namespaces_in_product_marketing_emails_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'namespaces_in_product_marketing_emails_worker'
][
'cron'
]
||=
'0 9 * * *'
Settings
.
cron_jobs
[
'namespaces_in_product_marketing_emails_worker'
][
'job_class'
]
=
'Namespaces::InProductMarketingEmailsWorker'
end
Gitlab
.
ee
do
Settings
.
cron_jobs
[
'analytics_devops_adoption_create_all_snapshots_worker'
]
||=
Settingslogic
.
new
({})
...
...
lib/gitlab.rb
View file @
83643a99
...
...
@@ -48,6 +48,10 @@ module Gitlab
Gitlab
.
config
.
gitlab
.
url
==
COM_URL
||
gl_subdomain?
end
def
self
.
com
yield
if
com?
end
def
self
.
staging?
Gitlab
.
config
.
gitlab
.
url
==
STAGING_COM_URL
end
...
...
spec/lib/gitlab_spec.rb
View file @
83643a99
...
...
@@ -95,6 +95,26 @@ RSpec.describe Gitlab do
end
end
describe
'.com'
do
subject
{
described_class
.
com
{
true
}
}
before
do
allow
(
described_class
).
to
receive
(
:com?
).
and_return
(
gl_com
)
end
context
'when on GitLab.com'
do
let
(
:gl_com
)
{
true
}
it
{
is_expected
.
to
be
true
}
end
context
'when not on GitLab.com'
do
let
(
:gl_com
)
{
false
}
it
{
is_expected
.
to
be_nil
}
end
end
describe
'.staging?'
do
subject
{
described_class
.
staging?
}
...
...
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