Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spm-agent

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spm-agent - npm Package Compare versions

Comparing version 1.0.27 to 1.0.28

   

49

lib/sender/spmsender.js

@@ -196,17 +196,38 @@ /*

}
function fsCheckStats (fileName, cbf)
{
fs.exists (fileName, function (exists) {
if (exists)
{
fs.stat (fileName, function (err, stats) {
cbf (err, stats)
})
} else {
cbf (new Error ('File not exisits:' + fileName))
}
})
}
function checkMaxDbSize () {
if (fs.existsSync(getFileNameForDb()) && fs.statSync(getFileNameForDb()).size >= (config.maxDbSize || 1024 * 1024 * 50)) {
db.remove({ts: {$lt: new Date().getTime() - (1000 * 60 * 60)}}, function (err, numRemoved) {
try {
if (err)
{
logger.error('checkMaxDbSize: removing old records from NeDB failed: %s', (err.msg||err.toString()))
} else {
logger.info ('checkMaxDbSize: maximum reached %d records deleted', numRemoved||0)
}
} catch (error) {
logger.error ('checkMaxDbSize: Unknown error:' + error, {error: error, dbError: err||'-', numRemoved: numRemoved||-1})
}
})
}
fsCheckStats (getFileNameForDb(), function (err, fsStat) {
if (!err)
{
if (fsStat.size >= 0 )// (config.maxDbSize || 1024 * 1024 * 50))
{
db.remove({ts: {$lt: new Date().getTime() - (1000 * 60 * 60)}}, function (err, numRemoved) {
try {
if (err)
{
logger.error('checkMaxDbSize: removing old records from NeDB failed: %s', (err.msg||err.toString()))
} else {
logger.info ('checkMaxDbSize: maximum reached %d records deleted', numRemoved||0)
}
} catch (error) {
logger.error ('checkMaxDbSize: Unknown error:' + error, {error: error, dbError: err||'-', numRemoved: numRemoved||-1})
}
})
}
}
})
}

@@ -213,0 +234,0 @@ SpmSender.prototype.sendErrorHandler = function (err) {

{
"name": "spm-agent",
"version": "1.0.27",
"version": "1.0.28",
"description": "Node.js agent framework for SPM by Sematext",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc