ignore more pusher warnings

This commit is contained in:
Sven Fuchs 2012-09-26 23:59:03 +02:00
parent 1a9f88587d
commit 958e7948d1

View File

@ -1,7 +1,7 @@
Travis.Pusher = -> Travis.Pusher = ->
@active_channels = [] @active_channels = []
if Travis.config.pusher?.key? if Travis.config.pusher?.key?
Pusher.warn = @warn Pusher.warn = @warn.bind(this)
@pusher = new Pusher(Travis.config.pusher.key) @pusher = new Pusher(Travis.config.pusher.key)
@subscribe(channel) for channel in Travis.Pusher.CHANNELS @subscribe(channel) for channel in Travis.Pusher.CHANNELS
this this
@ -41,5 +41,9 @@ $.extend Travis.Pusher.prototype,
when 'worker:added', 'worker:updated', 'worker:removed' when 'worker:added', 'worker:updated', 'worker:removed'
{ worker: data } { worker: data }
warn: (type, error) -> warn: (type, warning) ->
console.warn(error) unless error.data?.message && error.data.message.indexOf('No current subscription') > -1 console.warn(warning) unless @ignoreWarning(warning)
ignoreWarning: (warning) ->
if message = warning.data?.message
message.indexOf('Existing subscription') == 0 || message.indexOf('No current subscription') == 0