Use the api to do the filtering, avoiding fetching unnecessary data.

This commit is contained in:
Pagan Gazzard 2015-01-29 11:49:19 +00:00 committed by Pablo Carranza Vélez
parent 03f7b11c8b
commit 644ad14295

View File

@ -179,6 +179,7 @@ exports.update = update = ->
'commit'
]
filter:
commit: $ne: null
device:
uuid: uuid
customOptions:
@ -186,7 +187,6 @@ exports.update = update = ->
)
.then (remoteApps) ->
console.log('Remote apps')
remoteApps = _.filter(remoteApps, 'commit')
remoteApps = _.map remoteApps, (app) ->
env =
RESIN_DEVICE_UUID: uuid