mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #6230 from overleaf/jpa-collect-latency-get-dict
[web] collect latency for getting the users dict GitOrigin-RevId: ff13cfd7c27a64b15b36c0a0cd8653b4681be6b2
This commit is contained in:
parent
17eb841b31
commit
b1eac3abde
1 changed files with 3 additions and 0 deletions
|
@ -2,11 +2,13 @@ const request = require('request')
|
|||
const requestRetry = require('requestretry')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const OError = require('@overleaf/o-error')
|
||||
const Metrics = require('@overleaf/metrics')
|
||||
|
||||
const TIMEOUT = 10 * 1000
|
||||
|
||||
module.exports = {
|
||||
getUserDictionaryWithRetries(userId, callback) {
|
||||
const timer = new Metrics.Timer('spelling_get_dict')
|
||||
const options = {
|
||||
url: `${Settings.apis.spelling.url}/user/${userId}`,
|
||||
timeout: 3 * 1000,
|
||||
|
@ -30,6 +32,7 @@ module.exports = {
|
|||
)
|
||||
}
|
||||
|
||||
timer.done()
|
||||
callback(null, body)
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue