@chevre/domain 21.1.0-alpha.1 → 21.1.0-alpha.2
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.
- package/example/src/chevre/redisConfig.ts +8 -0
- package/lib/chevre/repo/action/registerServiceInProgress.d.ts +1 -1
- package/lib/chevre/repo/action/registerServiceInProgress.js +2 -2
- package/lib/chevre/repo/itemAvailability/screeningEvent.js +1 -1
- package/lib/chevre/repo/rateLimit/offer.js +1 -1
- package/package.json +1 -1
|
@@ -15,6 +15,14 @@ async function main() {
|
|
|
15
15
|
await client.connect();
|
|
16
16
|
|
|
17
17
|
console.log(await client.info());
|
|
18
|
+
|
|
19
|
+
const key = 'sampleTest';
|
|
20
|
+
const ttl = 60;
|
|
21
|
+
const results = await client.multi()
|
|
22
|
+
.setNX(key, '1')
|
|
23
|
+
.expire(key, ttl)
|
|
24
|
+
.exec();
|
|
25
|
+
console.log('results:', results);
|
|
18
26
|
}
|
|
19
27
|
|
|
20
28
|
main()
|
|
@@ -33,8 +33,8 @@ class RedisRepository {
|
|
|
33
33
|
.exec();
|
|
34
34
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
35
35
|
/* istanbul ignore else: please write tests */
|
|
36
|
-
if (results[0] === 1) {
|
|
37
|
-
return
|
|
36
|
+
if (results[0] === 1 || results[0] === true) {
|
|
37
|
+
return true;
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
40
|
throw new Error('Already in progress.');
|
|
@@ -52,7 +52,7 @@ class RedisRepository {
|
|
|
52
52
|
results.forEach((r, index) => {
|
|
53
53
|
debug('r, index:', r, index);
|
|
54
54
|
// tslint:disable-next-line:no-magic-numbers
|
|
55
|
-
if (index % 2 === 0 && r === 1) {
|
|
55
|
+
if (index % 2 === 0 && (r === 1 || r === true)) {
|
|
56
56
|
// tslint:disable-next-line:no-magic-numbers
|
|
57
57
|
lockedFields.push(datasets[index / 2].key);
|
|
58
58
|
}
|
package/package.json
CHANGED