keep track of queue length; omit some messages from entering the queue (pong,..)
This commit is contained in:
parent
e3efd24a2b
commit
d3f9f4e8a7
@ -53,9 +53,14 @@ class Meteor.RedisPubSub
|
||||
_Q: (pattern, channel, jsonMsg) =>
|
||||
message = JSON.parse(jsonMsg)
|
||||
eventName = message.header.name
|
||||
|
||||
messagesWeIgnore = [
|
||||
"BbbPubSubPongMessage"
|
||||
"bbb_apps_is_alive_message"
|
||||
]
|
||||
|
||||
unless eventName in messagesWeIgnore
|
||||
console.log "Q #{eventName} #{Meteor.myQueue.total()}"
|
||||
|
||||
|
||||
Meteor.myQueue.add({
|
||||
pattern: pattern
|
||||
channel: channel
|
||||
|
@ -26,10 +26,18 @@ Meteor.startup ->
|
||||
Meteor.log.error "got a failure on taskHandler #{eventName} #{failures}"
|
||||
else
|
||||
handleRedisMessage(data, ()->
|
||||
Meteor.log.error "in callback after handleRedisMessage #{eventName}"
|
||||
length = Meteor.myQueue.length()
|
||||
lengthString = ->
|
||||
if length>0
|
||||
"In the queue we have #{length} event(s) to process."
|
||||
else ""
|
||||
|
||||
Meteor.log.info "in callback after handleRedisMessage #{eventName}.
|
||||
#{lengthString()}"
|
||||
next()
|
||||
)
|
||||
|
||||
|
||||
# To ensure that we process the redis json event messages serially we use a
|
||||
# callback. This callback is to be called when the Meteor collection is
|
||||
# updated with the information coming in the payload of the json message. The
|
||||
@ -153,8 +161,6 @@ Meteor.startup ->
|
||||
# only process if requester is nodeJSapp means only process in the case when
|
||||
# we explicitly request the users
|
||||
else if eventName is 'get_users_reply' and message.payload.requester_id is 'nodeJSapp'
|
||||
|
||||
Meteor.log.error JSON.stringify(message)
|
||||
if !Meteor.Meetings.findOne({meetingId: meetingId})? #TODO consider removing this cond
|
||||
users = message.payload.users
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user