@huloglobal/vendure-plugin-quotations 0.7.2 → 0.7.3
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/CHANGELOG.md +5 -0
- package/dist/crons.d.ts.map +1 -1
- package/dist/crons.js +19 -1
- package/dist/crons.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ documented here. The format follows
|
|
|
5
5
|
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project
|
|
6
6
|
adheres to [semantic versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.7.3] — 2026-09-28
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- The hourly cron had no deadline: one stalled pass (seen on ELITE: stuck from noon, every later hour logged "previous run still in progress") blocked expiry and chasers until a restart. A pass now has a 15-minute deadline; on timeout it is logged with the step it was in and the single-flight guard is released. Chaser sends are conditional updates, so a late completion cannot double-send.
|
|
12
|
+
|
|
8
13
|
## [0.7.2] — 2026-09-28
|
|
9
14
|
|
|
10
15
|
### Changed
|
package/dist/crons.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crons.d.ts","sourceRoot":"","sources":["../src/crons.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,cAAc,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"crons.d.ts","sourceRoot":"","sources":["../src/crons.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,cAAc,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAQvD,qBACa,cAAc;IACX,OAAO,CAAC,OAAO;IAAoB,OAAO,CAAC,cAAc;gBAAjD,OAAO,EAAE,gBAAgB,EAAU,cAAc,EAAE,cAAc;IAErF;;6DAEyD;IACzD,OAAO,CAAC,WAAW,CAAS;IAE5B;+EAC2E;IAErE,MAAM;CA+Bf"}
|
package/dist/crons.js
CHANGED
|
@@ -16,6 +16,8 @@ const core_1 = require("@vendure/core");
|
|
|
16
16
|
const quotation_service_1 = require("./quotation.service");
|
|
17
17
|
const plugin_1 = require("./plugin");
|
|
18
18
|
const loggerCtx = 'Quotations';
|
|
19
|
+
/** Upper bound for one hourly pass; a stuck pass is logged and the guard released. */
|
|
20
|
+
const HOURLY_DEADLINE_MS = 15 * 60000;
|
|
19
21
|
let QuotationCrons = class QuotationCrons {
|
|
20
22
|
constructor(service, processContext) {
|
|
21
23
|
this.service = service;
|
|
@@ -37,16 +39,32 @@ let QuotationCrons = class QuotationCrons {
|
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
41
|
this.runInFlight = true;
|
|
40
|
-
|
|
42
|
+
// A run that never returns (a stalled SMTP or DB call) must not block
|
|
43
|
+
// every later hour: give it a deadline, log it, and free the guard.
|
|
44
|
+
// The chaser sends are per-quote conditional updates, so a late
|
|
45
|
+
// completion cannot double-send.
|
|
46
|
+
let step = 'expireOverdue';
|
|
47
|
+
const run = (async () => {
|
|
41
48
|
await this.service.expireOverdue();
|
|
42
49
|
if (plugin_1.QuotationsPlugin.hasPremiumAccess()) {
|
|
50
|
+
step = 'runChasers';
|
|
43
51
|
const r = await this.service.runChasers();
|
|
44
52
|
if (r.chasers || r.expiryReminders) {
|
|
45
53
|
core_1.Logger.info(`sent ${r.chasers} chaser(s) + ${r.expiryReminders} expiry reminder(s)`, loggerCtx);
|
|
46
54
|
}
|
|
47
55
|
}
|
|
56
|
+
})();
|
|
57
|
+
let timer;
|
|
58
|
+
const deadline = new Promise((_, reject) => { timer = setTimeout(() => reject(new Error(`hourly run exceeded ${HOURLY_DEADLINE_MS / 60000} min in ${step}`)), HOURLY_DEADLINE_MS); });
|
|
59
|
+
try {
|
|
60
|
+
await Promise.race([run, deadline]);
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
core_1.Logger.error(`quotations hourly run failed: ${(e === null || e === void 0 ? void 0 : e.message) || e}`, loggerCtx);
|
|
48
64
|
}
|
|
49
65
|
finally {
|
|
66
|
+
if (timer)
|
|
67
|
+
clearTimeout(timer);
|
|
50
68
|
this.runInFlight = false;
|
|
51
69
|
}
|
|
52
70
|
}
|
package/dist/crons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crons.js","sourceRoot":"","sources":["../src/crons.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAwD;AACxD,wCAAuD;AACvD,2DAAuD;AACvD,qCAAwD;AAExD,MAAM,SAAS,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"crons.js","sourceRoot":"","sources":["../src/crons.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAwD;AACxD,wCAAuD;AACvD,2DAAuD;AACvD,qCAAwD;AAExD,MAAM,SAAS,GAAG,YAAY,CAAC;AAE/B,sFAAsF;AACtF,MAAM,kBAAkB,GAAG,EAAE,GAAG,KAAM,CAAC;AAGhC,IAAM,cAAc,GAApB,MAAM,cAAc;IACvB,YAAoB,OAAyB,EAAU,cAA8B;QAAjE,YAAO,GAAP,OAAO,CAAkB;QAAU,mBAAc,GAAd,cAAc,CAAgB;QAErF;;iEAEyD;QACjD,gBAAW,GAAG,KAAK,CAAC;IAL4D,CAAC;IAOzF;+EAC2E;IAErE,AAAN,KAAK,CAAC,MAAM;QACR,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ;YAAE,OAAO;QACzC,IAAI,IAAA,mBAAU,GAAE,CAAC,WAAW;YAAE,OAAO;QACrC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YAAC,aAAM,CAAC,IAAI,CAAC,sDAAsD,EAAE,SAAS,CAAC,CAAC;YAAC,OAAO;QAAC,CAAC;QACjH,IAAI,CAAC,WAAW,GAAG,I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AAC,CAAC;YAC/B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAC7B,CAAC;IACL,CAAC;CACJ,CAAA;AA1CY,wCAAc;AAWjB;IADL,IAAA,eAAI,EAAC,yBAAc,CAAC,UAAU,CAAC;;;;4CA+B/B;yBAzCQ,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAEoB,oCAAgB,EAA0B,qBAAc;GAD5E,cAAc,CA0C1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huloglobal/vendure-plugin-quotations",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "End-to-end quotation engine for Vendure: build, send, track, chase and convert quotes to orders — with signatures, expiry, VAT and multi-channel branding.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|