@vendure/core 3.2.3 → 3.3.0
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/api/api-internal-modules.js +4 -0
- package/dist/api/api-internal-modules.js.map +1 -1
- package/dist/api/middleware/asset-interceptor-plugin.js +17 -2
- package/dist/api/middleware/asset-interceptor-plugin.js.map +1 -1
- package/dist/api/resolvers/admin/draft-order.resolver.d.ts +2 -1
- package/dist/api/resolvers/admin/draft-order.resolver.js +14 -0
- package/dist/api/resolvers/admin/draft-order.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/order.resolver.d.ts +1 -1
- package/dist/api/resolvers/admin/product.resolver.d.ts +1 -1
- package/dist/api/resolvers/admin/product.resolver.js +1 -2
- package/dist/api/resolvers/admin/product.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/scheduled-task.resolver.d.ts +9 -0
- package/dist/api/resolvers/admin/scheduled-task.resolver.js +62 -0
- package/dist/api/resolvers/admin/scheduled-task.resolver.js.map +1 -0
- package/dist/api/schema/admin-api/scheduled-task.api.graphql +25 -0
- package/dist/cache/cache.service.js +2 -0
- package/dist/cache/cache.service.js.map +1 -1
- package/dist/common/index.d.ts +6 -5
- package/dist/common/index.js +6 -5
- package/dist/common/index.js.map +1 -1
- package/dist/common/instrument-decorator.d.ts +41 -0
- package/dist/common/instrument-decorator.js +103 -0
- package/dist/common/instrument-decorator.js.map +1 -0
- package/dist/config/auth/default-password-validation-strategy.d.ts +2 -1
- package/dist/config/auth/default-password-validation-strategy.js +7 -2
- package/dist/config/auth/default-password-validation-strategy.js.map +1 -1
- package/dist/config/config.module.js +4 -1
- package/dist/config/config.module.js.map +1 -1
- package/dist/config/config.service.d.ts +2 -1
- package/dist/config/config.service.js +3 -0
- package/dist/config/config.service.js.map +1 -1
- package/dist/config/default-config.js +10 -1
- package/dist/config/default-config.js.map +1 -1
- package/dist/config/index.d.ts +8 -7
- package/dist/config/index.js +8 -7
- package/dist/config/index.js.map +1 -1
- package/dist/config/system/instrumentation-strategy.d.ts +56 -0
- package/dist/config/system/instrumentation-strategy.js +3 -0
- package/dist/config/system/instrumentation-strategy.js.map +1 -0
- package/dist/config/system/noop-instrumentation-strategy.d.ts +4 -0
- package/dist/config/system/noop-instrumentation-strategy.js +10 -0
- package/dist/config/system/noop-instrumentation-strategy.js.map +1 -0
- package/dist/config/vendure-config.d.ts +47 -1
- package/dist/connection/connection.module.d.ts +1 -1
- package/dist/event-bus/event-bus.js +2 -0
- package/dist/event-bus/event-bus.js.map +1 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.js +19 -18
- package/dist/index.js.map +1 -1
- package/dist/job-queue/job-queue.js +17 -2
- package/dist/job-queue/job-queue.js.map +1 -1
- package/dist/job-queue/job-queue.service.js +4 -1
- package/dist/job-queue/job-queue.service.js.map +1 -1
- package/dist/plugin/default-cache-plugin/sql-cache-strategy.js +16 -2
- package/dist/plugin/default-cache-plugin/sql-cache-strategy.js.map +1 -1
- package/dist/plugin/default-job-queue-plugin/clean-jobs-task.d.ts +11 -0
- package/dist/plugin/default-job-queue-plugin/clean-jobs-task.js +51 -0
- package/dist/plugin/default-job-queue-plugin/clean-jobs-task.js.map +1 -0
- package/dist/plugin/default-job-queue-plugin/constants.d.ts +2 -0
- package/dist/plugin/default-job-queue-plugin/constants.js +6 -0
- package/dist/plugin/default-job-queue-plugin/constants.js.map +1 -0
- package/dist/plugin/default-job-queue-plugin/default-job-queue-plugin.d.ts +24 -81
- package/dist/plugin/default-job-queue-plugin/default-job-queue-plugin.js +34 -0
- package/dist/plugin/default-job-queue-plugin/default-job-queue-plugin.js.map +1 -1
- package/dist/plugin/default-job-queue-plugin/types.d.ts +101 -0
- package/dist/plugin/default-job-queue-plugin/types.js +3 -0
- package/dist/plugin/default-job-queue-plugin/types.js.map +1 -0
- package/dist/plugin/default-scheduler-plugin/constants.d.ts +3 -0
- package/dist/plugin/default-scheduler-plugin/constants.js +7 -0
- package/dist/plugin/default-scheduler-plugin/constants.js.map +1 -0
- package/dist/plugin/default-scheduler-plugin/default-scheduler-strategy.d.ts +34 -0
- package/dist/plugin/default-scheduler-plugin/default-scheduler-strategy.js +203 -0
- package/dist/plugin/default-scheduler-plugin/default-scheduler-strategy.js.map +1 -0
- package/dist/plugin/default-scheduler-plugin/default-scheduler.plugin.d.ts +31 -0
- package/dist/plugin/default-scheduler-plugin/default-scheduler.plugin.js +69 -0
- package/dist/plugin/default-scheduler-plugin/default-scheduler.plugin.js.map +1 -0
- package/dist/plugin/default-scheduler-plugin/scheduled-task-record.entity.d.ts +10 -0
- package/dist/plugin/default-scheduler-plugin/scheduled-task-record.entity.js +50 -0
- package/dist/plugin/default-scheduler-plugin/scheduled-task-record.entity.js.map +1 -0
- package/dist/plugin/default-scheduler-plugin/types.d.ts +24 -0
- package/dist/plugin/default-scheduler-plugin/types.js +3 -0
- package/dist/plugin/default-scheduler-plugin/types.js.map +1 -0
- package/dist/plugin/index.d.ts +8 -6
- package/dist/plugin/index.js +8 -6
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/plugin-utils.js +2 -1
- package/dist/plugin/plugin-utils.js.map +1 -1
- package/dist/scheduler/index.d.ts +4 -0
- package/dist/scheduler/index.js +21 -0
- package/dist/scheduler/index.js.map +1 -0
- package/dist/scheduler/noop-scheduler-strategy.d.ts +10 -0
- package/dist/scheduler/noop-scheduler-strategy.js +24 -0
- package/dist/scheduler/noop-scheduler-strategy.js.map +1 -0
- package/dist/scheduler/scheduled-task.d.ts +142 -0
- package/dist/scheduler/scheduled-task.js +88 -0
- package/dist/scheduler/scheduled-task.js.map +1 -0
- package/dist/scheduler/scheduler-strategy.d.ts +91 -0
- package/dist/scheduler/scheduler-strategy.js +3 -0
- package/dist/scheduler/scheduler-strategy.js.map +1 -0
- package/dist/scheduler/scheduler.module.d.ts +2 -0
- package/dist/scheduler/scheduler.module.js +23 -0
- package/dist/scheduler/scheduler.module.js.map +1 -0
- package/dist/scheduler/scheduler.service.d.ts +40 -0
- package/dist/scheduler/scheduler.service.js +160 -0
- package/dist/scheduler/scheduler.service.js.map +1 -0
- package/dist/scheduler/tasks/clean-sessions-task.d.ts +37 -0
- package/dist/scheduler/tasks/clean-sessions-task.js +52 -0
- package/dist/scheduler/tasks/clean-sessions-task.js.map +1 -0
- package/dist/service/helpers/list-query-builder/list-query-builder.d.ts +2 -0
- package/dist/service/helpers/list-query-builder/list-query-builder.js +28 -4
- package/dist/service/helpers/list-query-builder/list-query-builder.js.map +1 -1
- package/dist/service/helpers/order-calculator/order-calculator.js +2 -0
- package/dist/service/helpers/order-calculator/order-calculator.js.map +1 -1
- package/dist/service/helpers/order-modifier/order-modifier.d.ts +1 -1
- package/dist/service/helpers/order-modifier/order-modifier.js +4 -2
- package/dist/service/helpers/order-modifier/order-modifier.js.map +1 -1
- package/dist/service/service.module.js +2 -1
- package/dist/service/service.module.js.map +1 -1
- package/dist/service/services/administrator.service.js +2 -0
- package/dist/service/services/administrator.service.js.map +1 -1
- package/dist/service/services/asset.service.js +3 -1
- package/dist/service/services/asset.service.js.map +1 -1
- package/dist/service/services/auth.service.d.ts +1 -1
- package/dist/service/services/auth.service.js +2 -0
- package/dist/service/services/auth.service.js.map +1 -1
- package/dist/service/services/channel.service.js +2 -0
- package/dist/service/services/channel.service.js.map +1 -1
- package/dist/service/services/collection.service.js +12 -6
- package/dist/service/services/collection.service.js.map +1 -1
- package/dist/service/services/country.service.js +2 -0
- package/dist/service/services/country.service.js.map +1 -1
- package/dist/service/services/customer-group.service.d.ts +1 -1
- package/dist/service/services/customer-group.service.js +3 -1
- package/dist/service/services/customer-group.service.js.map +1 -1
- package/dist/service/services/customer.service.d.ts +1 -1
- package/dist/service/services/customer.service.js +2 -0
- package/dist/service/services/customer.service.js.map +1 -1
- package/dist/service/services/facet-value.service.d.ts +1 -1
- package/dist/service/services/facet-value.service.js +2 -0
- package/dist/service/services/facet-value.service.js.map +1 -1
- package/dist/service/services/facet.service.js +2 -1
- package/dist/service/services/facet.service.js.map +1 -1
- package/dist/service/services/fulfillment.service.d.ts +1 -1
- package/dist/service/services/fulfillment.service.js +4 -2
- package/dist/service/services/fulfillment.service.js.map +1 -1
- package/dist/service/services/global-settings.service.js +2 -0
- package/dist/service/services/global-settings.service.js.map +1 -1
- package/dist/service/services/history.service.js +2 -0
- package/dist/service/services/history.service.js.map +1 -1
- package/dist/service/services/order-testing.service.js +3 -1
- package/dist/service/services/order-testing.service.js.map +1 -1
- package/dist/service/services/order.service.d.ts +1 -1
- package/dist/service/services/order.service.js +4 -2
- package/dist/service/services/order.service.js.map +1 -1
- package/dist/service/services/payment-method.service.js +2 -0
- package/dist/service/services/payment-method.service.js.map +1 -1
- package/dist/service/services/payment.service.js +4 -2
- package/dist/service/services/payment.service.js.map +1 -1
- package/dist/service/services/product-option-group.service.js +3 -1
- package/dist/service/services/product-option-group.service.js.map +1 -1
- package/dist/service/services/product-option.service.d.ts +1 -1
- package/dist/service/services/product-option.service.js +3 -1
- package/dist/service/services/product-option.service.js.map +1 -1
- package/dist/service/services/product-variant.service.d.ts +1 -1
- package/dist/service/services/product-variant.service.js +3 -1
- package/dist/service/services/product-variant.service.js.map +1 -1
- package/dist/service/services/product.service.js +13 -4
- package/dist/service/services/product.service.js.map +1 -1
- package/dist/service/services/promotion.service.js +2 -0
- package/dist/service/services/promotion.service.js.map +1 -1
- package/dist/service/services/role.service.js +2 -0
- package/dist/service/services/role.service.js.map +1 -1
- package/dist/service/services/seller.service.js +2 -0
- package/dist/service/services/seller.service.js.map +1 -1
- package/dist/service/services/session.service.d.ts +19 -2
- package/dist/service/services/session.service.js +60 -2
- package/dist/service/services/session.service.js.map +1 -1
- package/dist/service/services/shipping-method.service.js +2 -0
- package/dist/service/services/shipping-method.service.js.map +1 -1
- package/dist/service/services/stock-level.service.js +2 -0
- package/dist/service/services/stock-level.service.js.map +1 -1
- package/dist/service/services/stock-location.service.js +2 -0
- package/dist/service/services/stock-location.service.js.map +1 -1
- package/dist/service/services/stock-movement.service.d.ts +1 -3
- package/dist/service/services/stock-movement.service.js +4 -5
- package/dist/service/services/stock-movement.service.js.map +1 -1
- package/dist/service/services/tag.service.js +4 -1
- package/dist/service/services/tag.service.js.map +1 -1
- package/dist/service/services/tax-category.service.js +2 -0
- package/dist/service/services/tax-category.service.js.map +1 -1
- package/dist/service/services/tax-rate.service.js +2 -0
- package/dist/service/services/tax-rate.service.js.map +1 -1
- package/dist/service/services/user.service.js +2 -0
- package/dist/service/services/user.service.js.map +1 -1
- package/dist/service/services/zone.service.js +2 -0
- package/dist/service/services/zone.service.js.map +1 -1
- package/package.json +7 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export { generateMigration, revertLastMigration, runMigrations } from './migrate';
|
|
1
|
+
export { AdjustmentType, AssetType, CurrencyCode, LanguageCode, Permission, } from '@vendure/common/lib/generated-types';
|
|
2
|
+
export * from '@vendure/common/lib/shared-types';
|
|
4
3
|
export * from './api/index';
|
|
4
|
+
export * from './bootstrap';
|
|
5
5
|
export * from './cache/index';
|
|
6
6
|
export * from './common/index';
|
|
7
7
|
export * from './config/index';
|
|
8
8
|
export * from './connection/index';
|
|
9
|
+
export * from './data-import/index';
|
|
10
|
+
export * from './entity/index';
|
|
9
11
|
export * from './event-bus/index';
|
|
10
12
|
export * from './health-check/index';
|
|
13
|
+
export * from './i18n/index';
|
|
11
14
|
export * from './job-queue/index';
|
|
15
|
+
export { generateMigration, revertLastMigration, runMigrations } from './migrate';
|
|
12
16
|
export * from './plugin/index';
|
|
13
17
|
export * from './process-context/index';
|
|
14
|
-
export * from './
|
|
15
|
-
export * from './data-import/index';
|
|
18
|
+
export * from './scheduler/index';
|
|
16
19
|
export * from './service/index';
|
|
17
|
-
export
|
|
20
|
+
export { VENDURE_VERSION } from './version';
|
|
18
21
|
export * from './worker/index';
|
|
19
|
-
export * from '@vendure/common/lib/shared-types';
|
|
20
|
-
export { Permission, LanguageCode, CurrencyCode, AssetType, AdjustmentType, } from '@vendure/common/lib/generated-types';
|
package/dist/index.js
CHANGED
|
@@ -14,34 +14,35 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Object.defineProperty(exports, "
|
|
21
|
-
|
|
22
|
-
Object.defineProperty(exports, "
|
|
23
|
-
Object.defineProperty(exports, "
|
|
24
|
-
|
|
17
|
+
exports.VENDURE_VERSION = exports.runMigrations = exports.revertLastMigration = exports.generateMigration = exports.Permission = exports.LanguageCode = exports.CurrencyCode = exports.AssetType = exports.AdjustmentType = void 0;
|
|
18
|
+
var generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
19
|
+
Object.defineProperty(exports, "AdjustmentType", { enumerable: true, get: function () { return generated_types_1.AdjustmentType; } });
|
|
20
|
+
Object.defineProperty(exports, "AssetType", { enumerable: true, get: function () { return generated_types_1.AssetType; } });
|
|
21
|
+
Object.defineProperty(exports, "CurrencyCode", { enumerable: true, get: function () { return generated_types_1.CurrencyCode; } });
|
|
22
|
+
Object.defineProperty(exports, "LanguageCode", { enumerable: true, get: function () { return generated_types_1.LanguageCode; } });
|
|
23
|
+
Object.defineProperty(exports, "Permission", { enumerable: true, get: function () { return generated_types_1.Permission; } });
|
|
24
|
+
__exportStar(require("@vendure/common/lib/shared-types"), exports);
|
|
25
25
|
__exportStar(require("./api/index"), exports);
|
|
26
|
+
__exportStar(require("./bootstrap"), exports);
|
|
26
27
|
__exportStar(require("./cache/index"), exports);
|
|
27
28
|
__exportStar(require("./common/index"), exports);
|
|
28
29
|
__exportStar(require("./config/index"), exports);
|
|
29
30
|
__exportStar(require("./connection/index"), exports);
|
|
31
|
+
__exportStar(require("./data-import/index"), exports);
|
|
32
|
+
__exportStar(require("./entity/index"), exports);
|
|
30
33
|
__exportStar(require("./event-bus/index"), exports);
|
|
31
34
|
__exportStar(require("./health-check/index"), exports);
|
|
35
|
+
__exportStar(require("./i18n/index"), exports);
|
|
32
36
|
__exportStar(require("./job-queue/index"), exports);
|
|
37
|
+
var migrate_1 = require("./migrate");
|
|
38
|
+
Object.defineProperty(exports, "generateMigration", { enumerable: true, get: function () { return migrate_1.generateMigration; } });
|
|
39
|
+
Object.defineProperty(exports, "revertLastMigration", { enumerable: true, get: function () { return migrate_1.revertLastMigration; } });
|
|
40
|
+
Object.defineProperty(exports, "runMigrations", { enumerable: true, get: function () { return migrate_1.runMigrations; } });
|
|
33
41
|
__exportStar(require("./plugin/index"), exports);
|
|
34
42
|
__exportStar(require("./process-context/index"), exports);
|
|
35
|
-
__exportStar(require("./
|
|
36
|
-
__exportStar(require("./data-import/index"), exports);
|
|
43
|
+
__exportStar(require("./scheduler/index"), exports);
|
|
37
44
|
__exportStar(require("./service/index"), exports);
|
|
38
|
-
|
|
45
|
+
var version_1 = require("./version");
|
|
46
|
+
Object.defineProperty(exports, "VENDURE_VERSION", { enumerable: true, get: function () { return version_1.VENDURE_VERSION; } });
|
|
39
47
|
__exportStar(require("./worker/index"), exports);
|
|
40
|
-
__exportStar(require("@vendure/common/lib/shared-types"), exports);
|
|
41
|
-
var generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
42
|
-
Object.defineProperty(exports, "Permission", { enumerable: true, get: function () { return generated_types_1.Permission; } });
|
|
43
|
-
Object.defineProperty(exports, "LanguageCode", { enumerable: true, get: function () { return generated_types_1.LanguageCode; } });
|
|
44
|
-
Object.defineProperty(exports, "CurrencyCode", { enumerable: true, get: function () { return generated_types_1.CurrencyCode; } });
|
|
45
|
-
Object.defineProperty(exports, "AssetType", { enumerable: true, get: function () { return generated_types_1.AssetType; } });
|
|
46
|
-
Object.defineProperty(exports, "AdjustmentType", { enumerable: true, get: function () { return generated_types_1.AdjustmentType; } });
|
|
47
48
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uEAM6C;AALzC,iHAAA,cAAc,OAAA;AACd,4GAAA,SAAS,OAAA;AACT,+GAAA,YAAY,OAAA;AACZ,+GAAA,YAAY,OAAA;AACZ,6GAAA,UAAU,OAAA;AAEd,mEAAiD;AACjD,8CAA4B;AAC5B,8CAA4B;AAC5B,gDAA8B;AAC9B,iDAA+B;AAC/B,iDAA+B;AAC/B,qDAAmC;AACnC,sDAAoC;AACpC,iDAA+B;AAC/B,oDAAkC;AAClC,uDAAqC;AACrC,+CAA6B;AAC7B,oDAAkC;AAClC,qCAAkF;AAAzE,4GAAA,iBAAiB,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AAAE,wGAAA,aAAa,OAAA;AAC9D,iDAA+B;AAC/B,0DAAwC;AACxC,oDAAkC;AAClC,kDAAgC;AAChC,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,iDAA+B"}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.JobQueue = void 0;
|
|
13
|
+
const common_1 = require("../common");
|
|
4
14
|
const job_1 = require("./job");
|
|
15
|
+
const job_buffer_service_1 = require("./job-buffer/job-buffer.service");
|
|
5
16
|
const subscribable_job_1 = require("./subscribable-job");
|
|
6
17
|
/**
|
|
7
18
|
* @description
|
|
@@ -15,7 +26,7 @@ const subscribable_job_1 = require("./subscribable-job");
|
|
|
15
26
|
*
|
|
16
27
|
* @docsCategory JobQueue
|
|
17
28
|
*/
|
|
18
|
-
class JobQueue {
|
|
29
|
+
let JobQueue = class JobQueue {
|
|
19
30
|
get name() {
|
|
20
31
|
return this.options.name;
|
|
21
32
|
}
|
|
@@ -94,6 +105,10 @@ class JobQueue {
|
|
|
94
105
|
return new subscribable_job_1.SubscribableJob(bufferedJob, this.jobQueueStrategy);
|
|
95
106
|
}
|
|
96
107
|
}
|
|
97
|
-
}
|
|
108
|
+
};
|
|
98
109
|
exports.JobQueue = JobQueue;
|
|
110
|
+
exports.JobQueue = JobQueue = __decorate([
|
|
111
|
+
(0, common_1.Instrument)(),
|
|
112
|
+
__metadata("design:paramtypes", [Object, Object, job_buffer_service_1.JobBufferService])
|
|
113
|
+
], JobQueue);
|
|
99
114
|
//# sourceMappingURL=job-queue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-queue.js","sourceRoot":"","sources":["../../src/job-queue/job-queue.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"job-queue.js","sourceRoot":"","sources":["../../src/job-queue/job-queue.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAAuC;AAGvC,+BAA4B;AAC5B,wEAAmE;AACnE,yDAAqD;AAGrD;;;;;;;;;;;GAWG;AAEI,IAAM,QAAQ,GA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C;QAEH,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACxD,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAC/D,OAAO,IAAI,kCAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACJ,MAAM,WAAW,GAAG,IAAI,SAAG,iCACpB,GAAG,KACN,IAAI,EAAE,GAAG,CAAC,IAAI,EACd,EAAE,EAAE,UAAU,IAChB,CAAC;YACH,OAAO,IAAI,kCAAe,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACnE,CAAC;IACL,CAAC;CACJ,CAAA;AAxFY,4BAAQ;mBAAR,QAAQ;IADpB,IAAA,mBAAU,GAAE;qDAeqB,qCAAgB;GAdrC,QAAQ,CAwFpB"}
|
|
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.JobQueueService = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
|
+
const common_2 = require("../common");
|
|
14
15
|
const config_1 = require("../config");
|
|
15
16
|
const constants_1 = require("./constants");
|
|
16
17
|
const job_buffer_service_1 = require("./job-buffer/job-buffer.service");
|
|
@@ -192,6 +193,8 @@ let JobQueueService = class JobQueueService {
|
|
|
192
193
|
exports.JobQueueService = JobQueueService;
|
|
193
194
|
exports.JobQueueService = JobQueueService = __decorate([
|
|
194
195
|
(0, common_1.Injectable)(),
|
|
195
|
-
|
|
196
|
+
(0, common_2.Instrument)(),
|
|
197
|
+
__metadata("design:paramtypes", [config_1.ConfigService,
|
|
198
|
+
job_buffer_service_1.JobBufferService])
|
|
196
199
|
], JobQueueService);
|
|
197
200
|
//# sourceMappingURL=job-queue.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-queue.service.js","sourceRoot":"","sources":["../../src/job-queue/job-queue.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA6D;AAG7D,sCAAoE;AAEpE,2CAAwC;AAGxC,wEAAmE;AACnE,2CAAuC;AAGvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;
|
|
1
|
+
{"version":3,"file":"job-queue.service.js","sourceRoot":"","sources":["../../src/job-queue/job-queue.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA6D;AAG7D,sCAAuC;AACvC,sCAAoE;AAEpE,2CAAwC;AAGxC,wEAAmE;AACnE,2CAAuC;AAGvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGI,IAAM,eAAe,GAArB,MAAM,eAAe;IAIxB,IAAY,gBAAgB;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,gBAAgB,CAAC;IAC/D,CAAC;IAED,YACY,aAA4B,EAC5B,gBAAkC;QADlC,kBAAa,GAAb,aAAa,CAAe;QAC5B,qBAAgB,GAAhB,gBAAgB,CAAkB;QATtC,WAAM,GAAyB,EAAE,CAAC;QAClC,eAAU,GAAG,KAAK,CAAC;IASxB,CAAC;IAEJ,gBAAgB;IAChB,eAAe;QACX,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACvD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,CACb,OAAiC;QAEjC,IAAI,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;YAC5C,OAAO,mCAAQ,OAAO,KAAE,IAAI,EAAE,GAA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S,CAAC,EAAE,CAAC;gBACvE,OAAO,KAAK,CAAC;YACjB,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AA5JY,0CAAe;0BAAf,eAAe;IAF3B,IAAA,mBAAU,GAAE;IACZ,IAAA,mBAAU,GAAE;qCAUkB,sBAAa;QACV,qCAAgB;GAVrC,eAAe,CA4J3B"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.SqlCacheStrategy = void 0;
|
|
4
13
|
const cache_ttl_provider_1 = require("../../cache/cache-ttl-provider");
|
|
14
|
+
const instrument_decorator_1 = require("../../common/instrument-decorator");
|
|
5
15
|
const index_1 = require("../../config/index");
|
|
6
16
|
const index_2 = require("../../connection/index");
|
|
7
17
|
const cache_item_entity_1 = require("./cache-item.entity");
|
|
@@ -14,7 +24,7 @@ const cache_tag_entity_1 = require("./cache-tag.entity");
|
|
|
14
24
|
* @since 3.1.0
|
|
15
25
|
* @docsCategory cache
|
|
16
26
|
*/
|
|
17
|
-
class SqlCacheStrategy {
|
|
27
|
+
let SqlCacheStrategy = class SqlCacheStrategy {
|
|
18
28
|
constructor(config) {
|
|
19
29
|
this.cacheSize = 10000;
|
|
20
30
|
if (config === null || config === void 0 ? void 0 : config.cacheSize) {
|
|
@@ -132,6 +142,10 @@ class SqlCacheStrategy {
|
|
|
132
142
|
}
|
|
133
143
|
});
|
|
134
144
|
}
|
|
135
|
-
}
|
|
145
|
+
};
|
|
136
146
|
exports.SqlCacheStrategy = SqlCacheStrategy;
|
|
147
|
+
exports.SqlCacheStrategy = SqlCacheStrategy = __decorate([
|
|
148
|
+
(0, instrument_decorator_1.Instrument)(),
|
|
149
|
+
__metadata("design:paramtypes", [Object])
|
|
150
|
+
], SqlCacheStrategy);
|
|
137
151
|
//# sourceMappingURL=sql-cache-strategy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sql-cache-strategy.js","sourceRoot":"","sources":["../../../src/plugin/default-cache-plugin/sql-cache-strategy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sql-cache-strategy.js","sourceRoot":"","sources":["../../../src/plugin/default-cache-plugin/sql-cache-strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,uEAA2F;AAE3F,4EAA+D;AAC/D,8CAA2D;AAE3D,kDAAiE;AAEjE,2DAAgD;AAChD,yDAA8C;AAE9C;;;;;;;GAOG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAIzB,YAAY,MAAoE;QAHtE,cAAS,GAAG,KAAM,CAAC;QAIzB,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,EAAE,CAAC;YACpB,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,WAAW,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,KAAI,IAAI,4CAAuB,EAAE,CAAC;IACjF,CAAC;IAKD,IAAI,CAAC,QAAkB;QACnB,IAAI,CAAC,UAAU,GAAG,QA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;YAEf,MAAM,IAAI,CAAC,UAAU;iBAChB,aAAa,CAAC,GAAG,EAAE,2BAAQ,CAAC;iBAC5B,kBAAkB,CAAC,WAAW,CAAC;iBAC/B,MAAM,EAAE;iBACR,KAAK,CAAC,6BAA6B,EAAE,EAAE,IAAI,EAAE,CAAC;iBAC9C,OAAO,EAAE,CAAC;YAEf,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;gBACjB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;gBACvC,MAAM,SAAS,GAAG,IAAI,CAAC;gBAEvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC;oBACjD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;oBACtC,IAAI,CAAC;wBACD,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,EAAE,6BAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBACtE,CAAC;oBAAC,OAAO,CAAM,EAAE,CAAC;wBACd,cAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;oBACpD,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAvIY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,iCAAU,GAAE;;GACA,gBAAgB,CAuI5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ScheduledTask } from '../../scheduler/scheduled-task';
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* A {@link ScheduledTask} that cleans up old jobs from the database when using the DefaultJobQueuePlugin.
|
|
5
|
+
* You can configure the settings & schedule of the task via the {@link DefaultJobQueuePlugin} options.
|
|
6
|
+
*
|
|
7
|
+
* @since 3.3.0
|
|
8
|
+
* @docsCategory JobQueue
|
|
9
|
+
* @docsPage DefaultJobQueuePlugin
|
|
10
|
+
*/
|
|
11
|
+
export declare const cleanJobsTask: ScheduledTask<Record<string, any>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cleanJobsTask = void 0;
|
|
4
|
+
const config_1 = require("../../config");
|
|
5
|
+
const connection_1 = require("../../connection");
|
|
6
|
+
const scheduled_task_1 = require("../../scheduler/scheduled-task");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
const job_record_entity_1 = require("./job-record.entity");
|
|
9
|
+
/**
|
|
10
|
+
* @description
|
|
11
|
+
* A {@link ScheduledTask} that cleans up old jobs from the database when using the DefaultJobQueuePlugin.
|
|
12
|
+
* You can configure the settings & schedule of the task via the {@link DefaultJobQueuePlugin} options.
|
|
13
|
+
*
|
|
14
|
+
* @since 3.3.0
|
|
15
|
+
* @docsCategory JobQueue
|
|
16
|
+
* @docsPage DefaultJobQueuePlugin
|
|
17
|
+
*/
|
|
18
|
+
exports.cleanJobsTask = new scheduled_task_1.ScheduledTask({
|
|
19
|
+
id: 'clean-jobs',
|
|
20
|
+
description: 'Clean completed, failed, and cancelled jobs from the database',
|
|
21
|
+
schedule: cron => cron.every(2).hours(),
|
|
22
|
+
async execute({ injector, params }) {
|
|
23
|
+
const options = injector.get(constants_1.DEFAULT_JOB_QUEUE_PLUGIN_OPTIONS);
|
|
24
|
+
const keepJobsCount = options.keepJobsCount || constants_1.DEFAULT_KEEP_JOBS_COUNT;
|
|
25
|
+
const connection = injector.get(connection_1.TransactionalConnection);
|
|
26
|
+
const qb = connection.rawConnection
|
|
27
|
+
.getRepository(job_record_entity_1.JobRecord)
|
|
28
|
+
.createQueryBuilder('job')
|
|
29
|
+
.where(`job.state IN (:...states)`, {
|
|
30
|
+
states: ['COMPLETED', 'FAILED', 'CANCELLED'],
|
|
31
|
+
})
|
|
32
|
+
.orderBy('createdAt', 'ASC');
|
|
33
|
+
const count = await qb.getCount();
|
|
34
|
+
const BATCH_SIZE = 100;
|
|
35
|
+
const numberOfJobsToDelete = Math.max(count - keepJobsCount, 0);
|
|
36
|
+
if (0 < numberOfJobsToDelete) {
|
|
37
|
+
const jobsToDelete = await qb.select('id').limit(numberOfJobsToDelete).getRawMany();
|
|
38
|
+
config_1.Logger.verbose(`Cleaning up ${jobsToDelete.length} jobs...`);
|
|
39
|
+
for (let i = 0; i < jobsToDelete.length; i += BATCH_SIZE) {
|
|
40
|
+
const batch = jobsToDelete.slice(i, i + BATCH_SIZE);
|
|
41
|
+
await connection.rawConnection
|
|
42
|
+
.getRepository(job_record_entity_1.JobRecord)
|
|
43
|
+
.delete(batch.map(job => job.id));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
jobRecordsDeleted: numberOfJobsToDelete,
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=clean-jobs-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean-jobs-task.js","sourceRoot":"","sources":["../../../src/plugin/default-job-queue-plugin/clean-jobs-task.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,iDAA2D;AAC3D,mEAA+D;AAE/D,2CAAwF;AACxF,2DAAgD;AAGhD;;;;;;;;GAQG;AACU,QAAA,aAAa,GAAG,IAAI,8BAAa,CAAC;IAC3C,EAAE,EAAE,YAAY;IAChB,WAAW,EAAE,+DAA+D;IAC5E,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;IACvC,KAAK,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE;QAC9B,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAyB,4CAA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QACD,OAAO;YACH,iBAAiB,EAAE,oBAAoB;SAC1C,CAAC;IACN,CAAC;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_KEEP_JOBS_COUNT = exports.DEFAULT_JOB_QUEUE_PLUGIN_OPTIONS = void 0;
|
|
4
|
+
exports.DEFAULT_JOB_QUEUE_PLUGIN_OPTIONS = Symbol('DEFAULT_JOB_QUEUE_PLUGIN_OPTIONS');
|
|
5
|
+
exports.DEFAULT_KEEP_JOBS_COUNT = 1000;
|
|
6
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plugin/default-job-queue-plugin/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,gCAAgC,GAAG,MAAM,CAAC,kCAAkC,CAAC,CAAC;AAC9E,QAAA,uBAAuB,GAAG,IAAI,CAAC"}
|
|
@@ -1,85 +1,5 @@
|
|
|
1
1
|
import { Type } from '@vendure/common/lib/shared-types';
|
|
2
|
-
import {
|
|
3
|
-
import { BackoffStrategy } from '../../job-queue/polling-job-queue-strategy';
|
|
4
|
-
/**
|
|
5
|
-
* @description
|
|
6
|
-
* Configuration options for the DefaultJobQueuePlugin. These values get passed into the
|
|
7
|
-
* {@link SqlJobQueueStrategy}.
|
|
8
|
-
*
|
|
9
|
-
* @docsCategory JobQueue
|
|
10
|
-
* @docsPage DefaultJobQueuePlugin
|
|
11
|
-
*/
|
|
12
|
-
export interface DefaultJobQueueOptions {
|
|
13
|
-
/**
|
|
14
|
-
* @description
|
|
15
|
-
* The interval in ms between polling the database for new jobs. If many job queues
|
|
16
|
-
* are active, the polling may cause undue load on the database, in which case this value
|
|
17
|
-
* should be increased to e.g. 1000.
|
|
18
|
-
*
|
|
19
|
-
* @default 200
|
|
20
|
-
*/
|
|
21
|
-
pollInterval?: number | ((queueName: string) => number);
|
|
22
|
-
/**
|
|
23
|
-
* @description
|
|
24
|
-
* How many jobs from a given queue to process concurrently.
|
|
25
|
-
*
|
|
26
|
-
* @default 1
|
|
27
|
-
*/
|
|
28
|
-
concurrency?: number;
|
|
29
|
-
/**
|
|
30
|
-
* @description
|
|
31
|
-
* The strategy used to decide how long to wait before retrying a failed job.
|
|
32
|
-
*
|
|
33
|
-
* @default () => 1000
|
|
34
|
-
*/
|
|
35
|
-
backoffStrategy?: BackoffStrategy;
|
|
36
|
-
/**
|
|
37
|
-
* @description
|
|
38
|
-
* When a job is added to the JobQueue using `JobQueue.add()`, the calling
|
|
39
|
-
* code may specify the number of retries in case of failure. This option allows
|
|
40
|
-
* you to override that number and specify your own number of retries based on
|
|
41
|
-
* the job being added.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```ts
|
|
45
|
-
* setRetries: (queueName, job) => {
|
|
46
|
-
* if (queueName === 'send-email') {
|
|
47
|
-
* // Override the default number of retries
|
|
48
|
-
* // for the 'send-email' job because we have
|
|
49
|
-
* // a very unreliable email service.
|
|
50
|
-
* return 10;
|
|
51
|
-
* }
|
|
52
|
-
* return job.retries;
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
* @param queueName
|
|
56
|
-
* @param job
|
|
57
|
-
*/
|
|
58
|
-
setRetries?: (queueName: string, job: Job) => number;
|
|
59
|
-
/**
|
|
60
|
-
* @description
|
|
61
|
-
* If set to `true`, the database will be used to store buffered jobs. This is
|
|
62
|
-
* recommended for production.
|
|
63
|
-
*
|
|
64
|
-
* When enabled, a new `JobRecordBuffer` database entity will be defined which will
|
|
65
|
-
* require a migration when first enabling this option.
|
|
66
|
-
*
|
|
67
|
-
* @since 1.3.0
|
|
68
|
-
*/
|
|
69
|
-
useDatabaseForBuffer?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* @description
|
|
72
|
-
* The timeout in ms which the queue will use when attempting a graceful shutdown.
|
|
73
|
-
* That means when the server is shut down but a job is running, the job queue will
|
|
74
|
-
* wait for the job to complete before allowing the server to shut down. If the job
|
|
75
|
-
* does not complete within this timeout window, the job will be forced to stop
|
|
76
|
-
* and the server will shut down anyway.
|
|
77
|
-
*
|
|
78
|
-
* @since 2.2.0
|
|
79
|
-
* @default 20_000
|
|
80
|
-
*/
|
|
81
|
-
gracefulShutdownTimeout?: number;
|
|
82
|
-
}
|
|
2
|
+
import { DefaultJobQueueOptions } from './types';
|
|
83
3
|
/**
|
|
84
4
|
* @description
|
|
85
5
|
* A plugin which configures Vendure to use the SQL database to persist the JobQueue jobs using the {@link SqlJobQueueStrategy}. If you add this
|
|
@@ -167,7 +87,30 @@ export interface DefaultJobQueueOptions {
|
|
|
167
87
|
* };
|
|
168
88
|
* ```
|
|
169
89
|
*
|
|
90
|
+
* ### Removing old jobs
|
|
91
|
+
* Since v3.3, the job queue will automatically remove old jobs from the database. This is done by a scheduled task
|
|
92
|
+
* which runs every 2 hours by default. The number of jobs to keep in the database can be configured using the
|
|
93
|
+
* `keepJobsCount` option. The default is 1000.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* export const config: VendureConfig = {
|
|
98
|
+
* plugins: [
|
|
99
|
+
* DefaultJobQueuePlugin.init({
|
|
100
|
+
* // The number of completed/failed/cancelled
|
|
101
|
+
* // jobs to keep in the database. The default is 1000.
|
|
102
|
+
* keepJobsCount: 100,
|
|
103
|
+
* // The interval at which to run the clean-up task.
|
|
104
|
+
* // This can be a standard cron expression or a function
|
|
105
|
+
* // that returns a cron expression. The default is every 2 hours.
|
|
106
|
+
* cleanJobsSchedule: cron => cron.every(5).hours(),
|
|
107
|
+
* }),
|
|
108
|
+
* ],
|
|
109
|
+
* };
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
170
112
|
* @docsCategory JobQueue
|
|
113
|
+
* @docsPage DefaultJobQueuePlugin
|
|
171
114
|
* @docsWeight 0
|
|
172
115
|
*/
|
|
173
116
|
export declare class DefaultJobQueuePlugin {
|
|
@@ -10,6 +10,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.DefaultJobQueuePlugin = void 0;
|
|
11
11
|
const plugin_common_module_1 = require("../plugin-common.module");
|
|
12
12
|
const vendure_plugin_1 = require("../vendure-plugin");
|
|
13
|
+
const clean_jobs_task_1 = require("./clean-jobs-task");
|
|
14
|
+
const constants_1 = require("./constants");
|
|
13
15
|
const job_record_buffer_entity_1 = require("./job-record-buffer.entity");
|
|
14
16
|
const job_record_entity_1 = require("./job-record.entity");
|
|
15
17
|
const sql_job_buffer_storage_strategy_1 = require("./sql-job-buffer-storage-strategy");
|
|
@@ -101,7 +103,30 @@ const sql_job_queue_strategy_1 = require("./sql-job-queue-strategy");
|
|
|
101
103
|
* };
|
|
102
104
|
* ```
|
|
103
105
|
*
|
|
106
|
+
* ### Removing old jobs
|
|
107
|
+
* Since v3.3, the job queue will automatically remove old jobs from the database. This is done by a scheduled task
|
|
108
|
+
* which runs every 2 hours by default. The number of jobs to keep in the database can be configured using the
|
|
109
|
+
* `keepJobsCount` option. The default is 1000.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* export const config: VendureConfig = {
|
|
114
|
+
* plugins: [
|
|
115
|
+
* DefaultJobQueuePlugin.init({
|
|
116
|
+
* // The number of completed/failed/cancelled
|
|
117
|
+
* // jobs to keep in the database. The default is 1000.
|
|
118
|
+
* keepJobsCount: 100,
|
|
119
|
+
* // The interval at which to run the clean-up task.
|
|
120
|
+
* // This can be a standard cron expression or a function
|
|
121
|
+
* // that returns a cron expression. The default is every 2 hours.
|
|
122
|
+
* cleanJobsSchedule: cron => cron.every(5).hours(),
|
|
123
|
+
* }),
|
|
124
|
+
* ],
|
|
125
|
+
* };
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
104
128
|
* @docsCategory JobQueue
|
|
129
|
+
* @docsPage DefaultJobQueuePlugin
|
|
105
130
|
* @docsWeight 0
|
|
106
131
|
*/
|
|
107
132
|
let DefaultJobQueuePlugin = DefaultJobQueuePlugin_1 = class DefaultJobQueuePlugin {
|
|
@@ -132,8 +157,17 @@ exports.DefaultJobQueuePlugin = DefaultJobQueuePlugin = DefaultJobQueuePlugin_1
|
|
|
132
157
|
if (DefaultJobQueuePlugin.options.useDatabaseForBuffer === true) {
|
|
133
158
|
config.jobQueueOptions.jobBufferStorageStrategy = new sql_job_buffer_storage_strategy_1.SqlJobBufferStorageStrategy();
|
|
134
159
|
}
|
|
160
|
+
config.schedulerOptions.tasks.push(clean_jobs_task_1.cleanJobsTask.configure({
|
|
161
|
+
schedule: DefaultJobQueuePlugin.options.cleanJobsSchedule,
|
|
162
|
+
}));
|
|
135
163
|
return config;
|
|
136
164
|
},
|
|
165
|
+
providers: [
|
|
166
|
+
{
|
|
167
|
+
provide: constants_1.DEFAULT_JOB_QUEUE_PLUGIN_OPTIONS,
|
|
168
|
+
useFactory: () => DefaultJobQueuePlugin.options,
|
|
169
|
+
},
|
|
170
|
+
],
|
|
137
171
|
compatibility: '>0.0.0',
|
|
138
172
|
})
|
|
139
173
|
], DefaultJobQueuePlugin);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-job-queue-plugin.js","sourceRoot":"","sources":["../../../src/plugin/default-job-queue-plugin/default-job-queue-plugin.ts"],"names":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"default-job-queue-plugin.js","sourceRoot":"","sources":["../../../src/plugin/default-job-queue-plugin/default-job-queue-plugin.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,kEAA6D;AAC7D,sDAAkD;AAElD,uDAAkD;AAClD,2CAA+D;AAC/D,yEAA6D;AAC7D,2DAAgD;AAChD,uFAAgF;AAChF,qEAA+D;AAG/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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OAAO,EAAE,4CAAgC;gBACzC,UAAU,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,OAAO;aAClD;SACJ;QACD,aAAa,EAAE,QAAQ;KAC1B,CAAC;GACW,qBAAqB,CAQjC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { BackoffStrategy, Job } from '../../job-queue';
|
|
2
|
+
import { ScheduledTaskConfig } from '../../scheduler';
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Configuration options for the DefaultJobQueuePlugin. These values get passed into the
|
|
6
|
+
* {@link SqlJobQueueStrategy}.
|
|
7
|
+
*
|
|
8
|
+
* @docsCategory JobQueue
|
|
9
|
+
* @docsPage DefaultJobQueuePlugin
|
|
10
|
+
*/
|
|
11
|
+
export interface DefaultJobQueueOptions {
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
* The interval in ms between polling the database for new jobs. If many job queues
|
|
15
|
+
* are active, the polling may cause undue load on the database, in which case this value
|
|
16
|
+
* should be increased to e.g. 1000.
|
|
17
|
+
*
|
|
18
|
+
* @default 200
|
|
19
|
+
*/
|
|
20
|
+
pollInterval?: number | ((queueName: string) => number);
|
|
21
|
+
/**
|
|
22
|
+
* @description
|
|
23
|
+
* How many jobs from a given queue to process concurrently.
|
|
24
|
+
*
|
|
25
|
+
* @default 1
|
|
26
|
+
*/
|
|
27
|
+
concurrency?: number;
|
|
28
|
+
/**
|
|
29
|
+
* @description
|
|
30
|
+
* The strategy used to decide how long to wait before retrying a failed job.
|
|
31
|
+
*
|
|
32
|
+
* @default () => 1000
|
|
33
|
+
*/
|
|
34
|
+
backoffStrategy?: BackoffStrategy;
|
|
35
|
+
/**
|
|
36
|
+
* @description
|
|
37
|
+
* When a job is added to the JobQueue using `JobQueue.add()`, the calling
|
|
38
|
+
* code may specify the number of retries in case of failure. This option allows
|
|
39
|
+
* you to override that number and specify your own number of retries based on
|
|
40
|
+
* the job being added.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* setRetries: (queueName, job) => {
|
|
45
|
+
* if (queueName === 'send-email') {
|
|
46
|
+
* // Override the default number of retries
|
|
47
|
+
* // for the 'send-email' job because we have
|
|
48
|
+
* // a very unreliable email service.
|
|
49
|
+
* return 10;
|
|
50
|
+
* }
|
|
51
|
+
* return job.retries;
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
* @param queueName
|
|
55
|
+
* @param job
|
|
56
|
+
*/
|
|
57
|
+
setRetries?: (queueName: string, job: Job) => number;
|
|
58
|
+
/**
|
|
59
|
+
* @description
|
|
60
|
+
* If set to `true`, the database will be used to store buffered jobs. This is
|
|
61
|
+
* recommended for production.
|
|
62
|
+
*
|
|
63
|
+
* When enabled, a new `JobRecordBuffer` database entity will be defined which will
|
|
64
|
+
* require a migration when first enabling this option.
|
|
65
|
+
*
|
|
66
|
+
* @since 1.3.0
|
|
67
|
+
*/
|
|
68
|
+
useDatabaseForBuffer?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* @description
|
|
71
|
+
* The timeout in ms which the queue will use when attempting a graceful shutdown.
|
|
72
|
+
* That means when the server is shut down but a job is running, the job queue will
|
|
73
|
+
* wait for the job to complete before allowing the server to shut down. If the job
|
|
74
|
+
* does not complete within this timeout window, the job will be forced to stop
|
|
75
|
+
* and the server will shut down anyway.
|
|
76
|
+
*
|
|
77
|
+
* @since 2.2.0
|
|
78
|
+
* @default 20_000
|
|
79
|
+
*/
|
|
80
|
+
gracefulShutdownTimeout?: number;
|
|
81
|
+
/**
|
|
82
|
+
* @description
|
|
83
|
+
* The number of completed/failed jobs to keep in the database. This is useful for
|
|
84
|
+
* debugging and auditing purposes, but if you have a lot of jobs, it may be
|
|
85
|
+
* desirable to limit the number of records in the database.
|
|
86
|
+
*
|
|
87
|
+
* @since 3.3.0
|
|
88
|
+
* @default 1000
|
|
89
|
+
*/
|
|
90
|
+
keepJobsCount?: number;
|
|
91
|
+
/**
|
|
92
|
+
* @description
|
|
93
|
+
* The schedule for the "clean-jobs" task. This task will run periodically to clean up
|
|
94
|
+
* old jobs from the database. The schedule can be a cron expression or a function
|
|
95
|
+
* that returns a cron expression.
|
|
96
|
+
*
|
|
97
|
+
* @since 3.3.0
|
|
98
|
+
* @default cron => cron.every(2).hours()
|
|
99
|
+
*/
|
|
100
|
+
cleanJobsSchedule?: ScheduledTaskConfig['schedule'];
|
|
101
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plugin/default-job-queue-plugin/types.ts"],"names":[],"mappings":""}
|