filter pusher warnings about missing subscriptions
This commit is contained in:
parent
ccb4e27bdc
commit
192a2f44e1
|
@ -1,6 +1,7 @@
|
||||||
Travis.Pusher = ->
|
Travis.Pusher = ->
|
||||||
@active_channels = []
|
@active_channels = []
|
||||||
if Travis.config.pusher?.key?
|
if Travis.config.pusher?.key?
|
||||||
|
Pusher.warn = @warn
|
||||||
@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
|
||||||
|
@ -19,9 +20,7 @@ $.extend Travis.Pusher.prototype,
|
||||||
ix = @active_channels.indexOf(channel)
|
ix = @active_channels.indexOf(channel)
|
||||||
if @pusher && ix == -1
|
if @pusher && ix == -1
|
||||||
@active_channels.splice(ix, 1)
|
@active_channels.splice(ix, 1)
|
||||||
try
|
|
||||||
@pusher.unsubscribe(@prefix(channel))
|
@pusher.unsubscribe(@prefix(channel))
|
||||||
catch e
|
|
||||||
|
|
||||||
prefix: (channel) ->
|
prefix: (channel) ->
|
||||||
"#{Travis.Pusher.CHANNEL_PREFIX}#{channel}"
|
"#{Travis.Pusher.CHANNEL_PREFIX}#{channel}"
|
||||||
|
@ -42,3 +41,5 @@ $.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) ->
|
||||||
|
console.warn(error) unless error.data?.message && error.data.message.indexOf('No current subscription') > -1
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user