Socket
Socket
Sign inDemoInstall

neo4j-driver-core

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

neo4j-driver-core - npm Package Compare versions

Comparing version 5.24.1 to 5.25.0

55

lib/internal/pool/pool.js

@@ -283,6 +283,6 @@ "use strict";

pool = this._getOrInitializePoolFor(key);
if (!!requireNew) return [3 /*break*/, 9];
if (!!requireNew) return [3 /*break*/, 10];
_a.label = 1;
case 1:
if (!(pool.length > 0)) return [3 /*break*/, 9];
if (!(pool.length > 0)) return [3 /*break*/, 10];
resource_1 = pool.pop();

@@ -299,16 +299,17 @@ if (resource_1 == null) {

case 2:
_a.trys.push([2, 4, , 5]);
_a.trys.push([2, 4, , 6]);
return [4 /*yield*/, this._validateOnAcquire(acquisitionContext, resource_1)];
case 3:
valid = _a.sent();
return [3 /*break*/, 5];
return [3 /*break*/, 6];
case 4:
e_1 = _a.sent();
if (this._log.isErrorEnabled()) {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
this._log.error("Failure on validate ".concat(resource_1, ". This is a bug, please report it. Caused by: ").concat(e_1.message));
}
return [3 /*break*/, 5];
resourceReleased(key, this._activeResourceCounts);
pool.removeInUse(resource_1);
return [4 /*yield*/, this._destroy(resource_1)];
case 5:
if (!valid) return [3 /*break*/, 6];
_a.sent();
throw e_1;
case 6:
if (!valid) return [3 /*break*/, 7];
// idle resource is valid and can be acquired

@@ -320,11 +321,11 @@ if (this._log.isDebugEnabled()) {

return [2 /*return*/, { resource: resource_1, pool: pool }];
case 6:
case 7:
resourceReleased(key, this._activeResourceCounts);
pool.removeInUse(resource_1);
return [4 /*yield*/, this._destroy(resource_1)];
case 7:
case 8:
_a.sent();
_a.label = 8;
case 8: return [3 /*break*/, 1];
case 9:
_a.label = 9;
case 9: return [3 /*break*/, 1];
case 10:
// Ensure requested max pool size

@@ -341,9 +342,9 @@ if (this._maxSize > 0) {

this._pendingCreates[key] = this._pendingCreates[key] + 1;
_a.label = 10;
case 10:
_a.trys.push([10, , 14, 15]);
_a.label = 11;
case 11:
_a.trys.push([11, , 15, 16]);
numConnections = this.activeResourceCount(address) + pool.length;
if (!(numConnections >= this._maxSize && requireNew)) return [3 /*break*/, 12];
if (!(numConnections >= this._maxSize && requireNew)) return [3 /*break*/, 13];
resource_2 = pool.pop();
if (!(resource_2 != null)) return [3 /*break*/, 12];
if (!(resource_2 != null)) return [3 /*break*/, 13];
if (this._removeIdleObserver != null) {

@@ -354,6 +355,6 @@ this._removeIdleObserver(resource_2);

return [4 /*yield*/, this._destroy(resource_2)];
case 11:
case 12:
_a.sent();
_a.label = 12;
case 12: return [4 /*yield*/, this._create(acquisitionContext, address, function (address, resource) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
_a.label = 13;
case 13: return [4 /*yield*/, this._create(acquisitionContext, address, function (address, resource) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {

@@ -364,3 +365,3 @@ case 0: return [4 /*yield*/, this._release(address, resource, pool)];

}); }); })];
case 13:
case 14:
// Invoke callback that creates actual connection

@@ -374,7 +375,7 @@ resource = _a.sent();

}
return [3 /*break*/, 15];
case 14:
return [3 /*break*/, 16];
case 15:
this._pendingCreates[key] = this._pendingCreates[key] - 1;
return [7 /*endfinally*/];
case 15: return [2 /*return*/, { resource: resource, pool: pool }];
case 16: return [2 /*return*/, { resource: resource, pool: pool }];
}

@@ -381,0 +382,0 @@ });

{
"name": "neo4j-driver-core",
"version": "5.24.1",
"version": "5.25.0",
"description": "Internals of neo4j-driver",

@@ -48,3 +48,3 @@ "main": "lib/index.js",

},
"gitHead": "5768703f1ee332001f45f4b3c533d8f51963428f"
"gitHead": "da5b75b4e9e2568b1e4122b7d55d8cfe951b0750"
}
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