Skip to content

Commit

Permalink
adjust maxMetricsAge to 12 hrs
Browse files Browse the repository at this point in the history
  • Loading branch information
megastef committed Aug 14, 2019
1 parent 634057b commit 4b3cac0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sender/spmsender.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var programVersion = clientVersion
var dbFileName = null
var hostname = process.env.SPM_REPORTED_HOSTNAME || process.env.HOSTNAME || os.hostname()
var packageName = ''
var maxMetricsAge = 9 * 24 * 60 * 60 * 1000
var maxMetricsAge = 12 * 60 * 60 * 1000
try {
var path = require('path')
// lets try to find program name and version of the calling library
Expand Down Expand Up @@ -361,7 +361,7 @@ function checkMaxDbSize () {
fsCheckStats(getFileNameForDb(), function (err, fsStat) {
if (!err) {
if (fsStat.size >= (config.maxDbSize || 1024 * 1024 * 100)) {
db.remove({ts: {$lt: new Date().getTime() - (1000 * 60 * 60 * 12)}}, function (err, numRemoved) {
db.remove({ts: {$lt: new Date().getTime() - (maxMetricsAge)}}, function (err, numRemoved) {
try {
if (err) {
logger.error('checkMaxDbSize: removing old records from NeDB failed: %s', (err.msg || err.toString()))
Expand Down

0 comments on commit 4b3cac0

Please sign in to comment.