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
Tatuya Kamada
gitlab-ce
Commits
3015e768
Commit
3015e768
authored
Apr 06, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Reverse pipelines controller changes"
This reverts commit 0a60cdb110754a5e894ca1a2aa619842f2d98d1a.
parent
062806e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
10 deletions
+39
-10
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+39
-10
No files found.
app/controllers/projects/pipelines_controller.rb
View file @
3015e768
module
ActiveRecord
class
QueryRecorder
attr_reader
:log
attr_reader
:start
attr_reader
:end
def
initialize
(
&
block
)
@log
=
[]
@start
=
Time
.
now
ActiveSupport
::
Notifications
.
subscribed
(
method
(
:callback
),
'sql.active_record'
,
&
block
)
@end
=
Time
.
now
end
def
callback
(
name
,
start
,
finish
,
message_id
,
values
)
return
if
%w(SCHEMA)
.
include?
(
values
[
:name
])
@log
<<
values
[
:sql
]
end
def
time
@end
-
@start
end
def
count
@log
.
count
end
def
log_message
@log
.
join
(
"
\n\n
"
)
end
end
end
class
Projects::PipelinesController
<
Projects
::
ApplicationController
before_action
:pipeline
,
except:
[
:index
,
:new
,
:create
,
:charts
]
before_action
:commit
,
only:
[
:show
,
:builds
]
...
...
@@ -29,18 +61,15 @@ class Projects::PipelinesController < Projects::ApplicationController
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
{
pipelines:
PipelineSerializer
result
=
nil
queries
=
ActiveRecord
::
QueryRecorder
.
new
do
result
=
PipelineSerializer
.
new
(
project:
@project
,
user:
@current_user
)
.
with_pagination
(
request
,
response
)
.
represent
(
@pipelines
),
count:
{
all:
@pipelines_count
,
running:
@running_count
,
pending:
@pending_count
,
finished:
@finished_count
,
}
}
.
represent
(
@pipelines
)
end
render
json:
{
aa_queries:
queries
.
count
,
aa_time:
queries
.
time
,
result:
result
}
end
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