Comparing version 0.10.3 to 0.10.4
@@ -0,1 +1,8 @@ | ||
## [0.10.4](https://github.com/VaclavObornik/mongodash/compare/v0.10.3...v0.10.4) (2021-07-26) | ||
### Bug Fixes | ||
* added tests for withLock function ([dae54b2](https://github.com/VaclavObornik/mongodash/commit/dae54b23e9a2d4ad5277b8fb43ede1c586526b40)) | ||
## [0.10.3](https://github.com/VaclavObornik/mongodash/compare/v0.10.2...v0.10.3) (2021-07-26) | ||
@@ -2,0 +9,0 @@ |
/**! | ||
* mongodash v0.10.3 | ||
* mongodash v0.10.4 | ||
* https://github.com/VaclavObornik/mongodash.git | ||
@@ -4,0 +4,0 @@ * |
/**! | ||
* mongodash v0.10.3 | ||
* mongodash v0.10.4 | ||
* https://github.com/VaclavObornik/mongodash.git | ||
@@ -4,0 +4,0 @@ * |
/**! | ||
* mongodash v0.10.3 | ||
* mongodash v0.10.4 | ||
* https://github.com/VaclavObornik/mongodash.git | ||
@@ -4,0 +4,0 @@ * |
/**! | ||
* mongodash v0.10.3 | ||
* mongodash v0.10.4 | ||
* https://github.com/VaclavObornik/mongodash.git | ||
@@ -4,0 +4,0 @@ * |
/**! | ||
* mongodash v0.10.3 | ||
* mongodash v0.10.4 | ||
* https://github.com/VaclavObornik/mongodash.git | ||
@@ -4,0 +4,0 @@ * |
/**! | ||
* mongodash v0.10.3 | ||
* mongodash v0.10.4 | ||
* https://github.com/VaclavObornik/mongodash.git | ||
@@ -4,0 +4,0 @@ * |
/**! | ||
* mongodash v0.10.3 | ||
* mongodash v0.10.4 | ||
* https://github.com/VaclavObornik/mongodash.git | ||
@@ -23,2 +23,3 @@ * | ||
const lockAcquiredMessage = 'The lock is already acquired.'; | ||
const expirationKey = 'expiresAt'; | ||
let collectionPromise; | ||
@@ -29,3 +30,3 @@ async function getLockerCollection() { | ||
const collection = getCollection_1.getCollection('locks'); | ||
await collection.createIndex({ expiresAt: 1 }, { expireAfterSeconds: 0 }); | ||
await collection.createIndex({ [expirationKey]: 1 }, { name: 'expiresAtIndex', expireAfterSeconds: 0 }); | ||
return collection; | ||
@@ -39,3 +40,2 @@ })(); | ||
const stringKey = `${key}`; | ||
const expirationKey = 'expiresAt'; | ||
const collection = await getLockerCollection(); | ||
@@ -42,0 +42,0 @@ const releaseLock = () => collection.deleteOne({ _id: stringKey, lockId }); |
/**! | ||
* mongodash v0.10.3 | ||
* mongodash v0.10.4 | ||
* https://github.com/VaclavObornik/mongodash.git | ||
@@ -4,0 +4,0 @@ * |
{ | ||
"name": "mongodash", | ||
"version": "0.10.3", | ||
"version": "0.10.4", | ||
"description": "An utility library delivering super-useful and super-simple tools using MongoDB", | ||
@@ -5,0 +5,0 @@ "main": "dist/lib/index.js", |
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
53308