@did-space/core 0.4.4 → 0.4.7
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.
|
@@ -14,9 +14,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.GlobalSpace = void 0;
|
|
16
16
|
const lodash_1 = require("lodash");
|
|
17
|
+
const skypesky_sequelize_1 = require("skypesky-sequelize");
|
|
17
18
|
const mime_types_1 = __importDefault(require("mime-types"));
|
|
18
19
|
const debug_1 = __importDefault(require("debug"));
|
|
19
20
|
const p_all_1 = __importDefault(require("p-all"));
|
|
21
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
20
22
|
const utils_1 = require("../utils");
|
|
21
23
|
const global_space_1 = require("../schemas/global-space");
|
|
22
24
|
const schemas_1 = require("../schemas");
|
|
@@ -139,6 +141,11 @@ class GlobalSpace {
|
|
|
139
141
|
return __awaiter(this, void 0, void 0, function* () {
|
|
140
142
|
debug('gc.before', 'start gc...');
|
|
141
143
|
const objects = yield this.objectCollectionRepository.findAll({
|
|
144
|
+
where: {
|
|
145
|
+
createdAt: {
|
|
146
|
+
[skypesky_sequelize_1.Op.lt]: (0, dayjs_1.default)().subtract(10, 'm').toDate(),
|
|
147
|
+
},
|
|
148
|
+
},
|
|
142
149
|
attributes: ['id'],
|
|
143
150
|
order: [['createdAt', 'ASC']],
|
|
144
151
|
limit: this.gcMaxCount,
|
|
@@ -168,6 +175,7 @@ class GlobalSpace {
|
|
|
168
175
|
};
|
|
169
176
|
}), {
|
|
170
177
|
ignoreDuplicates: true,
|
|
178
|
+
updateOnDuplicate: ['createdAt'],
|
|
171
179
|
});
|
|
172
180
|
debug('mark.after', true);
|
|
173
181
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-space/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,10 +37,11 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@arcblock/ipfs-only-hash": "^0.0.2",
|
|
40
|
-
"@arcblock/validator": "^1.18.
|
|
40
|
+
"@arcblock/validator": "^1.18.120",
|
|
41
|
+
"dayjs": "^1.11.11",
|
|
41
42
|
"debug": "^4.3.4",
|
|
42
43
|
"hasha": "^5.2.2",
|
|
43
|
-
"joi": "^17.13.
|
|
44
|
+
"joi": "^17.13.1",
|
|
44
45
|
"js-yaml": "^4.1.0",
|
|
45
46
|
"lodash": "^4.17.21",
|
|
46
47
|
"mime-types": "^2.1.35",
|
|
@@ -52,13 +53,13 @@
|
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"@arcblock/eslint-config-ts": "^0.2.4",
|
|
54
55
|
"@types/jest": "^28.1.8",
|
|
55
|
-
"@types/node": "
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
56
|
+
"@types/node": "18.19.31",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
|
57
58
|
"eslint": "^8.57.0",
|
|
58
59
|
"jest": "^29.7.0",
|
|
59
60
|
"lint-staged": "^13.3.0",
|
|
60
61
|
"ts-jest": "^28.0.8",
|
|
61
62
|
"typescript": "^4.9.5"
|
|
62
63
|
},
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "42dfbdfd0b29bd69172e8365119c66a487d70d16"
|
|
64
65
|
}
|