mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-04 21:13:07 +00:00
clarify errors for subscribe/unsubscribe
This commit is contained in:
parent
f6f6f549d9
commit
3bf5dd5d6b
1 changed files with 4 additions and 4 deletions
|
@ -16,9 +16,9 @@ module.exports = ChannelManager =
|
|||
existingChannelSet = ClientMap.get(rclient) || @_createNewClientEntry(rclient)
|
||||
channel = "#{baseChannel}:#{id}"
|
||||
if existingChannelSet.has(channel)
|
||||
logger.error {channel}, "already subscribed"
|
||||
logger.error {channel}, "already subscribed - shouldn't happen"
|
||||
else
|
||||
rclient.subscribe channel
|
||||
rclient.subscribe channel # completes in the background
|
||||
existingChannelSet.add(channel)
|
||||
logger.log {channel}, "subscribed to new channel"
|
||||
metrics.inc "subscribe.#{baseChannel}"
|
||||
|
@ -27,9 +27,9 @@ module.exports = ChannelManager =
|
|||
existingChannelSet = ClientMap.get(rclient)
|
||||
channel = "#{baseChannel}:#{id}"
|
||||
if !existingChannelSet.has(channel)
|
||||
logger.error {channel}, "not subscribed, cannot unsubscribe"
|
||||
logger.error {channel}, "not subscribed - shouldn't happen"
|
||||
else
|
||||
rclient.unsubscribe channel
|
||||
rclient.unsubscribe channel # completes in the background
|
||||
existingChannelSet.delete(channel)
|
||||
logger.log {channel}, "unsubscribed from channel"
|
||||
metrics.inc "unsubscribe.#{baseChannel}"
|
||||
|
|
Loading…
Reference in a new issue