diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-08 23:53:09 +0200 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-08 23:53:09 +0200 |
commit | 4878820a75e213f97dd873b8784fc25e180d5dc6 (patch) | |
tree | 7c1921dd614accc32e15f079b9341d4ebc8a9869 | |
parent | 99d74174829c1fdeb23e2b977010afa7978c4049 (diff) | |
download | gitlab-ce-4878820a75e213f97dd873b8784fc25e180d5dc6.tar.gz |
Fix /running endpoint
-rw-r--r-- | lib/api/runner.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb index ab7b5bb6199..c61d25a17aa 100644 --- a/lib/api/runner.rb +++ b/lib/api/runner.rb @@ -101,10 +101,14 @@ module API authenticate_runner! status 200 - present Ci::Build.running + running = Ci::Build.running .where(runner: current_runner) .group(:project_id) - .pluck(:project_id, 'count(*)') + .pluck(:project_id, 'count(*)').map do |info| + { project_id: info.first, count: info.second } + end + + present running end end |