New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

larvitdb

Package Overview
Dependencies
Maintainers
1
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

larvitdb - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

25

larvitdb.js

@@ -14,3 +14,3 @@ 'use strict';

// Wrap the query function to log database errors or slow running queries
function query(sql, dbFields, retryNr, cb) {
function query(sql, dbFields, options, cb) {
try {

@@ -20,5 +20,5 @@ ready(function() {

if (typeof retryNr === 'function') {
cb = retryNr;
retryNr = 0;
if (typeof options === 'function') {
cb = options;
options = {};
}

@@ -29,3 +29,3 @@

dbFields = [];
retryNr = 0;
options = {};
}

@@ -37,2 +37,5 @@

if (options.retryNr === undefined) { options.retryNr = 0; }
if (options.ignoreLongQueryWarning === undefined) { options.ignoreLongQueryWarning = false; }
if (exports.pool === undefined) {

@@ -50,3 +53,3 @@ let err = new Error('larvitdb: No pool configured. sql: "' + sql + '" dbFields: ' + JSON.stringify(dbFields));

if (conf.longQueryTime !== false && conf.longQueryTime < queryTime) {
if (conf.longQueryTime !== false && conf.longQueryTime < queryTime && options.ignoreLongQueryWarning !== true) {
log.warn('larvitdb: Ran SQL: "' + sql + '" with dbFields: ' + JSON.stringify(dbFields) + ' in ' + queryTime + 'ms');

@@ -64,7 +67,7 @@ } else {

if (conf.recoverableErrors.indexOf(err.code) !== - 1) {
retryNr ++;
if (retryNr <= conf.retries) {
log.warn('larvitdb: Retrying database recoverable error: ' + err.message + ' retryNr: ' + retryNr + ' SQL: "' + sql + '" dbFields: ' + JSON.stringify(dbFields));
options.retryNr = options.retryNr + 1;
if (options.retryNr <= conf.retries) {
log.warn('larvitdb: Retrying database recoverable error: ' + err.message + ' retryNr: ' + options.retryNr + ' SQL: "' + sql + '" dbFields: ' + JSON.stringify(dbFields));
setTimeout(function() {
query(sql, dbFields, retryNr, cb);
query(sql, dbFields, {'retryNr': options.retryNr}, cb);
}, 50);

@@ -74,3 +77,3 @@ return;

log.error('larvitdb: Exhausted retries (' + retryNr + ') for database recoverable error: ' + err.message + ' SQL: "' + sql + '" dbFields: ' + JSON.stringify(dbFields));
log.error('larvitdb: Exhausted retries (' + options.retryNr + ') for database recoverable error: ' + err.message + ' SQL: "' + sql + '" dbFields: ' + JSON.stringify(dbFields));
cb(err);

@@ -77,0 +80,0 @@ return;

{
"name": "larvitdb",
"version": "1.2.3",
"version": "1.2.4",
"description": "DB wrapper module for node.js",

@@ -5,0 +5,0 @@ "main": "larvitdb.js",

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