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

@contember/database

Package Overview
Dependencies
Maintainers
5
Versions
263
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contember/database - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

1

dist/src/client/Pool.d.ts

@@ -118,2 +118,3 @@ /// <reference types="node" />

private handleAvailableConnection;
private removeIdleConnection;
private disposeConnection;

@@ -120,0 +121,0 @@ private log;

@@ -214,2 +214,7 @@ "use strict";

this.poolConfig.logError(new errors_1.ClientError(e, 'runtime error'));
this.poolStats.connection_error_count++;
if (!this.active.has(poolConnection)) {
this.removeIdleConnection(poolConnection);
this.disposeConnection(poolConnection);
}
});

@@ -345,5 +350,3 @@ try {

poolConnection.timerId = setTimeout(async () => {
const index = this.idle.indexOf(poolConnection);
if (index > -1) {
this.idle.splice(index, 1);
if (this.removeIdleConnection(poolConnection)) {
await this.disposeConnection(poolConnection);

@@ -358,2 +361,10 @@ this.poolStats.connection_disposed_idle_timeout_count++;

}
removeIdleConnection(poolConnection) {
const index = this.idle.indexOf(poolConnection);
if (index > -1) {
this.idle.splice(index, 1);
return true;
}
return false;
}
async disposeConnection(connection) {

@@ -360,0 +371,0 @@ try {

6

package.json
{
"name": "@contember/database",
"version": "1.2.0",
"version": "1.2.1",
"license": "Apache-2.0",

@@ -11,6 +11,6 @@ "main": "dist/src/index.js",

"dependencies": {
"@contember/queryable": "^1.2.0"
"@contember/queryable": "^1.2.1"
},
"devDependencies": {
"@contember/database-tester": "^1.2.0",
"@contember/database-tester": "^1.2.1",
"@types/node": "^18",

@@ -17,0 +17,0 @@ "pg": "^8.9.0"

@@ -309,2 +309,8 @@ import { ImplementationException } from '../exceptions'

this.poolConfig.logError(new ClientError(e, 'runtime error'))
this.poolStats.connection_error_count++
if (!this.active.has(poolConnection)) {
this.removeIdleConnection(poolConnection)
this.disposeConnection(poolConnection)
}
})

@@ -414,3 +420,2 @@ try {

private handleAvailableConnection(poolConnection: PoolConnection) {

@@ -442,5 +447,3 @@ const item = this.queue.shift()

poolConnection.timerId = setTimeout(async () => {
const index = this.idle.indexOf(poolConnection)
if (index > -1) {
this.idle.splice(index, 1)
if (this.removeIdleConnection(poolConnection)) {
await this.disposeConnection(poolConnection)

@@ -456,2 +459,12 @@ this.poolStats.connection_disposed_idle_timeout_count++

private removeIdleConnection(poolConnection: PoolConnection) {
const index = this.idle.indexOf(poolConnection)
if (index > -1) {
this.idle.splice(index, 1)
return true
}
return false
}
private async disposeConnection(connection: PoolConnection) {

@@ -458,0 +471,0 @@ try {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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