@aomex/cache
Advanced tools
Comparing version 0.0.6 to 0.0.7
# @aomex/cache | ||
## 0.0.7 | ||
### Patch Changes | ||
- [`bf2c963`](https://github.com/aomex/aomex/commit/bf2c9639a609402be2ff094ceabe4fd2231214f8) Thanks [@geekact](https://github.com/geekact)! - fix(cache): forget to return while calling addValue | ||
- [`e3b1be4`](https://github.com/aomex/aomex/commit/e3b1be4d02793001d441a1f1b1ced060e95b4f8a) Thanks [@geekact](https://github.com/geekact)! - fix(cache): addValue may be incorrect with multiple threads | ||
## 0.0.6 | ||
@@ -4,0 +12,0 @@ |
@@ -78,3 +78,7 @@ // src/cache.ts | ||
async addValue(key, value, duration) { | ||
return await this.existsKey(key) ? false : this.setValue(key, value, duration); | ||
if (await this.existsKey(key)) | ||
return false; | ||
if (!await this.setValue(key, value, duration)) | ||
return false; | ||
return await this.getValue(key) === value; | ||
} | ||
@@ -81,0 +85,0 @@ }; |
{ | ||
"name": "@aomex/cache", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "module", |
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
17120
214