@naturalcycles/abba 1.18.3 → 1.18.4
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/dist/abba.js +2 -2
- package/package.json +2 -4
- package/src/abba.ts +2 -2
- package/src/util.ts +1 -1
package/dist/abba.js
CHANGED
|
@@ -12,7 +12,7 @@ const util_1 = require("./util");
|
|
|
12
12
|
/**
|
|
13
13
|
* 10 minutes
|
|
14
14
|
*/
|
|
15
|
-
const CACHE_TTL =
|
|
15
|
+
const CACHE_TTL = 600_000; // 10 minutes
|
|
16
16
|
class Abba {
|
|
17
17
|
constructor(cfg) {
|
|
18
18
|
this.cfg = cfg;
|
|
@@ -240,5 +240,5 @@ class Abba {
|
|
|
240
240
|
}
|
|
241
241
|
exports.Abba = Abba;
|
|
242
242
|
tslib_1.__decorate([
|
|
243
|
-
(0, js_lib_1.
|
|
243
|
+
(0, js_lib_1._Memo)({ cacheFactory: () => new nodejs_lib_1.LRUMemoCache({ ttl: CACHE_TTL, max: 1 }) })
|
|
244
244
|
], Abba.prototype, "getAllExperiments", null);
|
package/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/abba",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.4",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"prepare": "husky
|
|
6
|
-
"build": "build",
|
|
7
|
-
"build-prod": "build-prod"
|
|
5
|
+
"prepare": "husky"
|
|
8
6
|
},
|
|
9
7
|
"dependencies": {
|
|
10
8
|
"@naturalcycles/db-lib": "^9.1.0",
|
package/src/abba.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _assert,
|
|
1
|
+
import { _assert, _Memo, _shuffle, pMap } from '@naturalcycles/js-lib'
|
|
2
2
|
import { LRUMemoCache } from '@naturalcycles/nodejs-lib'
|
|
3
3
|
import { bucketDao } from './dao/bucket.dao'
|
|
4
4
|
import { experimentDao } from './dao/experiment.dao'
|
|
@@ -38,7 +38,7 @@ export class Abba {
|
|
|
38
38
|
* Returns all experiments.
|
|
39
39
|
* Cached (see CACHE_TTL)
|
|
40
40
|
*/
|
|
41
|
-
@
|
|
41
|
+
@_Memo({ cacheFactory: () => new LRUMemoCache({ ttl: CACHE_TTL, max: 1 }) })
|
|
42
42
|
async getAllExperiments(): Promise<ExperimentWithBuckets[]> {
|
|
43
43
|
return await this.getAllExperimentsNoCache()
|
|
44
44
|
}
|