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:
parent
21fecf855a
commit
edb4e19309
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user