mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
[misc] do not register a noop sweeping interval
This commit is contained in:
committed by
Jakob Ackermann
parent
29742d6a87
commit
20223d865f
@@ -143,18 +143,22 @@ PromWrapper.setupSweeping = function() {
|
||||
if (sweepingInterval) {
|
||||
clearInterval(sweepingInterval)
|
||||
}
|
||||
if (!PromWrapper.ttlInMinutes) {
|
||||
if (process.env.DEBUG_METRICS) {
|
||||
console.log('Not registering sweep method -- empty ttl')
|
||||
}
|
||||
return
|
||||
}
|
||||
if (process.env.DEBUG_METRICS) {
|
||||
console.log('Registering sweep method')
|
||||
}
|
||||
sweepingInterval = setInterval(function() {
|
||||
if (PromWrapper.ttlInMinutes) {
|
||||
if (process.env.DEBUG_METRICS) {
|
||||
console.log('Sweeping metrics')
|
||||
}
|
||||
return metrics.forEach((metric, key) => {
|
||||
return metric.sweep()
|
||||
})
|
||||
if (process.env.DEBUG_METRICS) {
|
||||
console.log('Sweeping metrics')
|
||||
}
|
||||
return metrics.forEach((metric, key) => {
|
||||
return metric.sweep()
|
||||
})
|
||||
}, 60000)
|
||||
|
||||
const Metrics = require('./index')
|
||||
|
||||
Reference in New Issue
Block a user