Comparing version 7.0.2 to 7.1.0
@@ -17,2 +17,12 @@ # Changelog | ||
## [7.1.0] - 2020-10-16 | ||
### Changed | ||
- Killing a cursor now also drains it locally | ||
### Fixed | ||
- Fixed a potential memory leak in cursor batch handling | ||
## [7.0.2] - 2020-09-25 | ||
@@ -24,3 +34,3 @@ | ||
- Fixed empty query results containing `[undefined]` ([#687](https://github.com/arangodb/arangojs/issues/683)) | ||
- Fixed empty query results containing `[undefined]` ([#683](https://github.com/arangodb/arangojs/issues/683)) | ||
@@ -1108,2 +1118,3 @@ - Fixed `updateByExample` and `replaceByExample` new value parameter name | ||
[7.1.0]: https://github.com/arangodb/arangojs/compare/v7.0.2...v7.1.0 | ||
[7.0.2]: https://github.com/arangodb/arangojs/compare/v7.0.1...v7.0.2 | ||
@@ -1110,0 +1121,0 @@ [7.0.1]: https://github.com/arangodb/arangojs/compare/v7.0.0...v7.0.1 |
@@ -430,5 +430,5 @@ /** | ||
/** | ||
* Kills the cursor and frees up associated database resources. | ||
* Drains the cursor and frees up associated database resources. | ||
* | ||
* This method has no effect if all batches have already been fetched. | ||
* This method has no effect if all batches have already been consumed. | ||
* | ||
@@ -435,0 +435,0 @@ * @example |
@@ -232,3 +232,7 @@ "use strict"; | ||
const batch = this._batches.shift(); | ||
return batch && [...batch.values()]; | ||
if (!batch) | ||
return undefined; | ||
const values = [...batch.values()]; | ||
batch.clear(true); | ||
return values; | ||
} | ||
@@ -411,5 +415,5 @@ /** | ||
/** | ||
* Kills the cursor and frees up associated database resources. | ||
* Drains the cursor and frees up associated database resources. | ||
* | ||
* This method has no effect if all batches have already been fetched. | ||
* This method has no effect if all batches have already been consumed. | ||
* | ||
@@ -431,2 +435,8 @@ * @example | ||
async kill() { | ||
if (this._batches.length) { | ||
for (const batch of this._batches.values()) { | ||
batch.clear(); | ||
} | ||
this._batches.clear(); | ||
} | ||
if (!this.hasNext) | ||
@@ -433,0 +443,0 @@ return undefined; |
{ | ||
"name": "arangojs", | ||
"version": "7.0.2", | ||
"version": "7.1.0", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=10" |
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 too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2067337
10575
18125