update to new api

This commit is contained in:
Shane Kilkelly 2017-03-17 15:16:38 +00:00
parent f58f256864
commit 619e49ab04
2 changed files with 17 additions and 51 deletions

View file

@ -64,30 +64,13 @@ module.exports = MessageManager =
if query._id? and query._id not instanceof ObjectId
query._id = ObjectId(query._id)
return query
metrics.timeAsyncMethod(
MessageManager, 'createMessage',
'MessageManager.createMessage',
logger
)
metrics.timeAsyncMethod(
MessageManager, 'getMessages',
'MessageManager.getMessages',
logger
)
metrics.timeAsyncMethod(
MessageManager, 'findAllMessagesInRooms',
'MessageManager.findAllMessagesInRooms',
logger
)
metrics.timeAsyncMethod(
MessageManager, 'updateMessage',
'MessageManager.updateMessage',
logger
)
metrics.timeAsyncMethod(
MessageManager, 'deleteMessage',
'MessageManager.deleteMessage',
logger
)
[
'createMessage',
'getMessages',
'findAllMessagesInRooms',
'updateMessage',
'deleteMessage'
].map (method) ->
metrics.timeAsyncMethod(MessageManager, method, 'mongo.MessageManager', logger)

View file

@ -78,28 +78,11 @@ module.exports = ThreadManager =
return callback null, room._id
metrics.timeAsyncMethod(
ThreadManager, 'findOrCreateThread',
'ThreadManager.findOrCreateThread',
logger
)
metrics.timeAsyncMethod(
ThreadManager, 'findAllThreadRooms',
'ThreadManager.findAllThreadRooms',
logger
)
metrics.timeAsyncMethod(
ThreadManager, 'resolveThread',
'ThreadManager.resolveThread',
logger
)
metrics.timeAsyncMethod(
ThreadManager, 'reopenThread',
'ThreadManager.reopenThread',
logger
)
metrics.timeAsyncMethod(
ThreadManager, 'deleteThread',
'ThreadManager.deleteThread',
logger
)
[
'findOrCreateThread',
'findAllThreadRooms',
'resolveThread',
'reopenThread',
'deleteThread',
].map (method) ->
metrics.timeAsyncMethod(ThreadManager, method, 'mongo.ThreadManager', logger)