Comparing version 3.5.13 to 3.5.14
@@ -5,2 +5,6 @@ # Changelog | ||
## [3.5.14][] - 2021-09-21 | ||
- Fix bugs in Pool and add tests for important cases | ||
## [3.5.13][] - 2021-09-20 | ||
@@ -113,3 +117,4 @@ | ||
[unreleased]: https://github.com/metarhia/metautil/compare/v3.5.13....HEAD | ||
[unreleased]: https://github.com/metarhia/metautil/compare/v3.5.14....HEAD | ||
[3.5.14]: https://github.com/metarhia/metautil/compare/v3.5.13...v3.5.14 | ||
[3.5.13]: https://github.com/metarhia/metautil/compare/v3.5.12...v3.5.13 | ||
@@ -116,0 +121,0 @@ [3.5.12]: https://github.com/metarhia/metautil/compare/v3.5.11...v3.5.12 |
@@ -33,3 +33,3 @@ 'use strict'; | ||
this.current++; | ||
} while (!item && !free); | ||
} while (!item || !free); | ||
if (this.current === this.size) this.current = 0; | ||
@@ -65,3 +65,3 @@ return item; | ||
clearTimeout(timer); | ||
if (resolve) setTimeout(resolve, item); | ||
if (resolve) setTimeout(resolve, 0, item); | ||
} | ||
@@ -68,0 +68,0 @@ } |
@@ -13,3 +13,3 @@ 'use strict'; | ||
enter() { | ||
async enter() { | ||
return new Promise((resolve, reject) => { | ||
@@ -16,0 +16,0 @@ if (this.counter > 0) { |
@@ -90,6 +90,2 @@ import { EventEmitter } from 'events'; | ||
//interface PoolOptions { | ||
// timeout?: number; | ||
//} | ||
export class Pool { | ||
@@ -96,0 +92,0 @@ constructor(options: { timeout?: number }); |
{ | ||
"name": "metautil", | ||
"version": "3.5.13", | ||
"version": "3.5.14", | ||
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
28523
646