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
5bb7b196
Commit
5bb7b196
authored
Aug 25, 2021
by
Allison Browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address CR feedback
parent
e5ef10c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
app/models/commit_status.rb
app/models/commit_status.rb
+1
-1
app/workers/stuck_ci_jobs_worker.rb
app/workers/stuck_ci_jobs_worker.rb
+2
-5
No files found.
app/models/commit_status.rb
View file @
5bb7b196
...
...
@@ -59,7 +59,7 @@ class CommitStatus < Ci::ApplicationRecord
scope
:eager_load_pipeline
,
->
{
eager_load
(
:pipeline
,
project:
{
namespace: :route
})
}
scope
:with_pipeline
,
->
{
joins
(
:pipeline
)
}
scope
:created_at_before
,
->
(
date
)
{
where
(
'ci_builds.created_at < ?'
,
date
)
}
scope
:updated_at_before
,
->
(
date
)
{
where
(
'updated_at < ?'
,
date
)
}
scope
:updated_at_before
,
->
(
date
)
{
where
(
'
ci_builds.
updated_at < ?'
,
date
)
}
scope
:updated_before
,
->
(
lookback
:,
timeout
:)
{
where
(
'(ci_builds.created_at BETWEEN ? AND ?) AND (ci_builds.updated_at BETWEEN ? AND ?)'
,
lookback
,
timeout
,
lookback
,
timeout
)
}
...
...
app/workers/stuck_ci_jobs_worker.rb
View file @
5bb7b196
...
...
@@ -64,13 +64,10 @@ class StuckCiJobsWorker # rubocop:disable Scalability/IdempotentWorker
def
running_timed_out_builds
if
Feature
.
enabled?
(
:ci_new_query_for_running_stuck_jobs
)
running_builds
=
Ci
::
Build
.
running
.
created_at_before
(
BUILD_RUNNING_OUTDATED_TIMEOUT
.
ago
)
running_builds
=
Ci
::
Build
.
running
.
created_at_before
(
BUILD_RUNNING_OUTDATED_TIMEOUT
.
ago
)
.
order
(
created_at: :asc
,
project_id: :asc
)
# rubocop: disable CodeReuse/ActiveRecord
Ci
::
Build
.
id_in
(
running_builds
).
updated_at_before
(
BUILD_RUNNING_OUTDATED_TIMEOUT
.
ago
)
else
Ci
::
Build
.
running
.
where
(
# rubocop: disable CodeReuse/ActiveRecord
'ci_builds.updated_at < ?'
,
BUILD_RUNNING_OUTDATED_TIMEOUT
.
ago
)
Ci
::
Build
.
running
.
updated_at_before
(
BUILD_RUNNING_OUTDATED_TIMEOUT
.
ago
)
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