Run lastBuildDidChange only once for a runloop run

When a lot of pusher events come with build updates, lastBuildDidChange
can run quite frequently. We can avoid that by using scheduleOnce, which
will ensure that only the last invocation of lastBuildDidChange will be
run for a given runloop run.
This commit is contained in:
Piotr Sarnacki 2013-12-05 17:12:22 +01:00
parent 21fecf855a
commit edb4e19309

View File

@ -50,6 +50,9 @@ Travis.RepoController = Travis.Controller.extend
@connectTab('job')
lastBuildDidChange: ->
Ember.run.scheduleOnce('data', this, @_lastBuildDidChange);
_lastBuildDidChange: ->
build = @get('repo.lastBuild')
@set('build', build)