neo4j-driver 5.24.1 → 5.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5774,10 +5774,10 @@ var Pool$1 = /** @class */ (function () {
|
|
|
5774
5774
|
}
|
|
5775
5775
|
key = address.asKey();
|
|
5776
5776
|
pool = this._getOrInitializePoolFor(key);
|
|
5777
|
-
if (!!requireNew) return [3 /*break*/,
|
|
5777
|
+
if (!!requireNew) return [3 /*break*/, 10];
|
|
5778
5778
|
_a.label = 1;
|
|
5779
5779
|
case 1:
|
|
5780
|
-
if (!(pool.length > 0)) return [3 /*break*/,
|
|
5780
|
+
if (!(pool.length > 0)) return [3 /*break*/, 10];
|
|
5781
5781
|
resource_1 = pool.pop();
|
|
5782
5782
|
if (resource_1 == null) {
|
|
5783
5783
|
return [3 /*break*/, 1];
|
|
@@ -5789,35 +5789,36 @@ var Pool$1 = /** @class */ (function () {
|
|
|
5789
5789
|
valid = false;
|
|
5790
5790
|
_a.label = 2;
|
|
5791
5791
|
case 2:
|
|
5792
|
-
_a.trys.push([2, 4, ,
|
|
5792
|
+
_a.trys.push([2, 4, , 6]);
|
|
5793
5793
|
return [4 /*yield*/, this._validateOnAcquire(acquisitionContext, resource_1)];
|
|
5794
5794
|
case 3:
|
|
5795
5795
|
valid = _a.sent();
|
|
5796
|
-
return [3 /*break*/,
|
|
5796
|
+
return [3 /*break*/, 6];
|
|
5797
5797
|
case 4:
|
|
5798
5798
|
e_1 = _a.sent();
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
}
|
|
5803
|
-
return [3 /*break*/, 5];
|
|
5799
|
+
resourceReleased(key, this._activeResourceCounts);
|
|
5800
|
+
pool.removeInUse(resource_1);
|
|
5801
|
+
return [4 /*yield*/, this._destroy(resource_1)];
|
|
5804
5802
|
case 5:
|
|
5805
|
-
|
|
5803
|
+
_a.sent();
|
|
5804
|
+
throw e_1;
|
|
5805
|
+
case 6:
|
|
5806
|
+
if (!valid) return [3 /*break*/, 7];
|
|
5806
5807
|
// idle resource is valid and can be acquired
|
|
5807
5808
|
if (this._log.isDebugEnabled()) {
|
|
5808
5809
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
5809
5810
|
this._log.debug("".concat(resource_1, " acquired from the pool ").concat(key));
|
|
5810
5811
|
}
|
|
5811
5812
|
return [2 /*return*/, { resource: resource_1, pool: pool }];
|
|
5812
|
-
case
|
|
5813
|
+
case 7:
|
|
5813
5814
|
resourceReleased(key, this._activeResourceCounts);
|
|
5814
5815
|
pool.removeInUse(resource_1);
|
|
5815
5816
|
return [4 /*yield*/, this._destroy(resource_1)];
|
|
5816
|
-
case
|
|
5817
|
+
case 8:
|
|
5817
5818
|
_a.sent();
|
|
5818
|
-
_a.label =
|
|
5819
|
-
case
|
|
5820
|
-
case
|
|
5819
|
+
_a.label = 9;
|
|
5820
|
+
case 9: return [3 /*break*/, 1];
|
|
5821
|
+
case 10:
|
|
5821
5822
|
// Ensure requested max pool size
|
|
5822
5823
|
if (this._maxSize > 0) {
|
|
5823
5824
|
numConnections = this.activeResourceCount(address) + this._pendingCreates[key];
|
|
@@ -5829,28 +5830,28 @@ var Pool$1 = /** @class */ (function () {
|
|
|
5829
5830
|
// there exist no idle valid resources, create a new one for acquisition
|
|
5830
5831
|
// Keep track of how many pending creates there are to avoid making too many connections.
|
|
5831
5832
|
this._pendingCreates[key] = this._pendingCreates[key] + 1;
|
|
5832
|
-
_a.label =
|
|
5833
|
-
case
|
|
5834
|
-
_a.trys.push([
|
|
5833
|
+
_a.label = 11;
|
|
5834
|
+
case 11:
|
|
5835
|
+
_a.trys.push([11, , 15, 16]);
|
|
5835
5836
|
numConnections = this.activeResourceCount(address) + pool.length;
|
|
5836
|
-
if (!(numConnections >= this._maxSize && requireNew)) return [3 /*break*/,
|
|
5837
|
+
if (!(numConnections >= this._maxSize && requireNew)) return [3 /*break*/, 13];
|
|
5837
5838
|
resource_2 = pool.pop();
|
|
5838
|
-
if (!(resource_2 != null)) return [3 /*break*/,
|
|
5839
|
+
if (!(resource_2 != null)) return [3 /*break*/, 13];
|
|
5839
5840
|
if (this._removeIdleObserver != null) {
|
|
5840
5841
|
this._removeIdleObserver(resource_2);
|
|
5841
5842
|
}
|
|
5842
5843
|
pool.removeInUse(resource_2);
|
|
5843
5844
|
return [4 /*yield*/, this._destroy(resource_2)];
|
|
5844
|
-
case
|
|
5845
|
+
case 12:
|
|
5845
5846
|
_a.sent();
|
|
5846
|
-
_a.label =
|
|
5847
|
-
case
|
|
5847
|
+
_a.label = 13;
|
|
5848
|
+
case 13: return [4 /*yield*/, this._create(acquisitionContext, address, function (address, resource) { return __awaiter$i(_this, void 0, void 0, function () { return __generator$k(this, function (_a) {
|
|
5848
5849
|
switch (_a.label) {
|
|
5849
5850
|
case 0: return [4 /*yield*/, this._release(address, resource, pool)];
|
|
5850
5851
|
case 1: return [2 /*return*/, _a.sent()];
|
|
5851
5852
|
}
|
|
5852
5853
|
}); }); })];
|
|
5853
|
-
case
|
|
5854
|
+
case 14:
|
|
5854
5855
|
// Invoke callback that creates actual connection
|
|
5855
5856
|
resource = _a.sent();
|
|
5856
5857
|
pool.pushInUse(resource);
|
|
@@ -5859,11 +5860,11 @@ var Pool$1 = /** @class */ (function () {
|
|
|
5859
5860
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
5860
5861
|
this._log.debug("".concat(resource, " created for the pool ").concat(key));
|
|
5861
5862
|
}
|
|
5862
|
-
return [3 /*break*/,
|
|
5863
|
-
case
|
|
5863
|
+
return [3 /*break*/, 16];
|
|
5864
|
+
case 15:
|
|
5864
5865
|
this._pendingCreates[key] = this._pendingCreates[key] - 1;
|
|
5865
5866
|
return [7 /*endfinally*/];
|
|
5866
|
-
case
|
|
5867
|
+
case 16: return [2 /*return*/, { resource: resource, pool: pool }];
|
|
5867
5868
|
}
|
|
5868
5869
|
});
|
|
5869
5870
|
});
|
|
@@ -21682,7 +21683,7 @@ Object.defineProperty(version$1, "__esModule", { value: true });
|
|
|
21682
21683
|
// This is set up this way to keep the version in the code in
|
|
21683
21684
|
// sync with the npm package version, and to allow the build
|
|
21684
21685
|
// system to control version names at packaging time.
|
|
21685
|
-
version$1.default = '5.
|
|
21686
|
+
version$1.default = '5.25.0';
|
|
21686
21687
|
|
|
21687
21688
|
var lib = {};
|
|
21688
21689
|
|