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
f7ef78a7
Commit
f7ef78a7
authored
Sep 13, 2018
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a comment to the usage of a anti-pattern query
parent
b4e2cc44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
app/models/ci/runner.rb
app/models/ci/runner.rb
+6
-0
No files found.
app/models/ci/runner.rb
View file @
f7ef78a7
...
@@ -31,6 +31,12 @@ module Ci
...
@@ -31,6 +31,12 @@ module Ci
scope
:active
,
->
{
where
(
active:
true
)
}
scope
:active
,
->
{
where
(
active:
true
)
}
scope
:paused
,
->
{
where
(
active:
false
)
}
scope
:paused
,
->
{
where
(
active:
false
)
}
scope
:online
,
->
{
where
(
'contacted_at > ?'
,
contact_time_deadline
)
}
scope
:online
,
->
{
where
(
'contacted_at > ?'
,
contact_time_deadline
)
}
# 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
# indexed search and rejects the ones that are in the previous set. If we
# did `contacted_at <= ?` the query would effectively have to do a seq
# scan.
scope
:offline
,
->
{
where
.
not
(
id:
online
)
}
scope
:offline
,
->
{
where
.
not
(
id:
online
)
}
scope
:ordered
,
->
{
order
(
id: :desc
)
}
scope
:ordered
,
->
{
order
(
id: :desc
)
}
...
...
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