mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
update to new api
This commit is contained in:
parent
f58f256864
commit
619e49ab04
2 changed files with 17 additions and 51 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue