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
7251ab41
Commit
7251ab41
authored
May 28, 2021
by
Alexandru Croitor
Committed by
Pedro Pombeiro
May 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify recent Runner scope
parent
512b4f97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
app/models/ci/runner.rb
app/models/ci/runner.rb
+1
-1
No files found.
app/models/ci/runner.rb
View file @
7251ab41
...
...
@@ -60,7 +60,7 @@ module Ci
scope
:active
,
->
{
where
(
active:
true
)
}
scope
:paused
,
->
{
where
(
active:
false
)
}
scope
:online
,
->
{
where
(
'contacted_at > ?'
,
online_contact_time_deadline
)
}
scope
:recent
,
->
{
where
(
'
(contacted_at IS ? AND ci_runners.created_at > ?) OR contacted_at > ?'
,
nil
,
3
.
months
.
ago
,
3
.
months
.
ago
)
}
scope
:recent
,
->
{
where
(
'
ci_runners.created_at > :date OR contacted_at > :date'
,
date:
3
.
months
.
ago
)
}
# The following query using negation is cheaper than using `contacted_at <= ?`
# because there are less runners online than have been created. The
# resulting query is quickly finding online ones and then uses the regular
...
...
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