Use less expensive endpoints for getting repos with last builds
We display a few recently built repos on landing page. Till now it was using quite expensive endpoint "/repos". This commit changes it to get last builds from builds endpoint and then fetch repositories by ids.
This commit is contained in:
parent
6b6f0a6994
commit
648d7579e4
|
@ -28,8 +28,10 @@ Route = BasicRoute.extend
|
|||
|
||||
setTimeout =>
|
||||
unless repos.get('length')
|
||||
@store.find('repo').then (reposFromRequest) ->
|
||||
repos.get('external').pushObjects reposFromRequest.toArray().slice(0, 3)
|
||||
@store.find('build').then (builds) =>
|
||||
repoIds = builds.mapBy('data.repo').uniq().slice(0, 3)
|
||||
@store.find('repo', ids: repoIds).then (reposFromRequest) ->
|
||||
repos.get('external').pushObjects reposFromRequest.toArray()
|
||||
, 10000
|
||||
|
||||
@_super.apply this, arguments
|
||||
|
|
Loading…
Reference in New Issue
Block a user