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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
20de2480
Commit
20de2480
authored
Sep 26, 2018
by
Shinya Maeda
Committed by
Alessio Caiazza
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix stuck ci jobs worker
parent
6eee8d2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
app/workers/stuck_ci_jobs_worker.rb
app/workers/stuck_ci_jobs_worker.rb
+1
-1
No files found.
app/workers/stuck_ci_jobs_worker.rb
View file @
20de2480
...
@@ -76,7 +76,7 @@ class StuckCiJobsWorker
...
@@ -76,7 +76,7 @@ class StuckCiJobsWorker
# `ci_builds` table has a partial index on `id` with `scheduled_at <> NULL` condition.
# `ci_builds` table has a partial index on `id` with `scheduled_at <> NULL` condition.
# Therefore this query's first step uses Index Search, and the following expensive
# Therefore this query's first step uses Index Search, and the following expensive
# filter `scheduled_at < ?` will only perform on a small subset (max: 100 rows)
# filter `scheduled_at < ?` will only perform on a small subset (max: 100 rows)
Ci
::
Build
.
include
(
EachBach
).
where
(
'scheduled_at <> NULL'
).
each_batch
(
of:
100
)
do
|
relation
|
Ci
::
Build
.
include
(
EachBa
t
ch
).
where
(
'scheduled_at <> NULL'
).
each_batch
(
of:
100
)
do
|
relation
|
relation
.
where
(
'scheduled_at < ?'
,
BUILD_SCHEDULED_OUTDATED_TIMEOUT
.
ago
).
find_each
do
|
build
|
relation
.
where
(
'scheduled_at < ?'
,
BUILD_SCHEDULED_OUTDATED_TIMEOUT
.
ago
).
find_each
do
|
build
|
drop_build
(
:outdated
,
build
,
:scheduled
,
BUILD_SCHEDULED_OUTDATED_TIMEOUT
,
:schedule_expired
)
drop_build
(
:outdated
,
build
,
:scheduled
,
BUILD_SCHEDULED_OUTDATED_TIMEOUT
,
:schedule_expired
)
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