@nocobase/plugin-workflow-javascript 2.1.41 → 2.1.43
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/externalVersion.js
CHANGED
|
@@ -13,12 +13,12 @@ module.exports = {
|
|
|
13
13
|
"antd-style": "3.7.1",
|
|
14
14
|
"@formily/antd-v5": "1.2.3",
|
|
15
15
|
"@ant-design/icons": "5.6.1",
|
|
16
|
-
"@nocobase/client": "2.1.
|
|
17
|
-
"@nocobase/plugin-workflow": "2.1.
|
|
16
|
+
"@nocobase/client": "2.1.43",
|
|
17
|
+
"@nocobase/plugin-workflow": "2.1.43",
|
|
18
18
|
"antd": "5.24.2",
|
|
19
|
-
"@nocobase/flow-engine": "2.1.
|
|
19
|
+
"@nocobase/flow-engine": "2.1.43",
|
|
20
20
|
"react-i18next": "11.18.6",
|
|
21
21
|
"winston": "3.13.0",
|
|
22
|
-
"@nocobase/server": "2.1.
|
|
22
|
+
"@nocobase/server": "2.1.43",
|
|
23
23
|
"sequelize": "6.35.2"
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-08-
|
|
1
|
+
{"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-08-19T08:55:32.400Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"winston-transport","description":"Base stream implementations for winston@3 and up.","version":"4.7.0","main":"index.js","browser":"dist/index.js","scripts":{"lint":"eslint test/*.js index.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist","pretest":"npm run lint && npm run build","test":"nyc mocha test/*.test.js","report":"nyc report --reporter=lcov","build":"rimraf dist && babel *.js -d ./dist","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git@github.com:winstonjs/winston-transport.git"},"keywords":["winston","transport","winston3"],"author":"Charlie Robbins <charlie.robbins@gmail.com>","license":"MIT","bugs":{"url":"https://github.com/winstonjs/winston-transport/issues"},"homepage":"https://github.com/winstonjs/winston-transport#readme","dependencies":{"logform":"^2.3.2","readable-stream":"^3.6.0","triple-beam":"^1.3.0"},"devDependencies":{"@types/node":"^20.8.6","abstract-winston-transport":">=0.5.1","assume":"^2.3.0","babel-cli":"^6.26.0","babel-preset-env":"^1.7.0","deep-equal":"^2.0.5","eslint":"^8.8.0","@dabh/eslint-config-populist":"^5.0.0","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^5.0.5","winston-compat":"^0.1.5"},"engines":{"node":">= 12.0.0"},"_lastModified":"2026-08-
|
|
1
|
+
{"name":"winston-transport","description":"Base stream implementations for winston@3 and up.","version":"4.7.0","main":"index.js","browser":"dist/index.js","scripts":{"lint":"eslint test/*.js index.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist","pretest":"npm run lint && npm run build","test":"nyc mocha test/*.test.js","report":"nyc report --reporter=lcov","build":"rimraf dist && babel *.js -d ./dist","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git@github.com:winstonjs/winston-transport.git"},"keywords":["winston","transport","winston3"],"author":"Charlie Robbins <charlie.robbins@gmail.com>","license":"MIT","bugs":{"url":"https://github.com/winstonjs/winston-transport/issues"},"homepage":"https://github.com/winstonjs/winston-transport#readme","dependencies":{"logform":"^2.3.2","readable-stream":"^3.6.0","triple-beam":"^1.3.0"},"devDependencies":{"@types/node":"^20.8.6","abstract-winston-transport":">=0.5.1","assume":"^2.3.0","babel-cli":"^6.26.0","babel-preset-env":"^1.7.0","deep-equal":"^2.0.5","eslint":"^8.8.0","@dabh/eslint-config-populist":"^5.0.0","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^5.0.5","winston-compat":"^0.1.5"},"engines":{"node":">= 12.0.0"},"_lastModified":"2026-08-19T08:55:33.092Z"}
|
|
@@ -35,6 +35,7 @@ var import_constants = require("../common/constants");
|
|
|
35
35
|
const RECOVERY_BATCH_SIZE = 100;
|
|
36
36
|
const RECOVERY_MAX_SCAN_SIZE = 1e3;
|
|
37
37
|
const RECOVERY_INTERVAL = 6e4;
|
|
38
|
+
const RECOVERY_GRACE_PERIOD = RECOVERY_INTERVAL;
|
|
38
39
|
class TaskRecovery {
|
|
39
40
|
constructor(workflowPlugin, taskQueueChannel) {
|
|
40
41
|
this.workflowPlugin = workflowPlugin;
|
|
@@ -85,14 +86,19 @@ class TaskRecovery {
|
|
|
85
86
|
async republishQueuedJobs() {
|
|
86
87
|
let cursor = null;
|
|
87
88
|
let scanned = 0;
|
|
88
|
-
const
|
|
89
|
+
const now = /* @__PURE__ */ new Date();
|
|
90
|
+
const recoverableBefore = new Date(now.getTime() - RECOVERY_GRACE_PERIOD);
|
|
91
|
+
const staleBefore = new Date(now.getTime() - 12e4);
|
|
89
92
|
const logger = this.workflowPlugin.getLogger("javascript");
|
|
90
93
|
const JobModel = this.workflowPlugin.db.getModel("jobs");
|
|
91
94
|
while (scanned < RECOVERY_MAX_SCAN_SIZE) {
|
|
92
95
|
const jobs = await JobModel.findAll({
|
|
93
96
|
where: {
|
|
94
97
|
...cursor == null ? {} : { id: { [import_sequelize.Op.gt]: cursor } },
|
|
95
|
-
status: import_plugin_workflow.JOB_STATUS.PENDING
|
|
98
|
+
status: import_plugin_workflow.JOB_STATUS.PENDING,
|
|
99
|
+
createdAt: {
|
|
100
|
+
[import_sequelize.Op.lt]: recoverableBefore
|
|
101
|
+
}
|
|
96
102
|
},
|
|
97
103
|
attributes: ["id", "startedAt", "updatedAt"],
|
|
98
104
|
include: [
|
|
@@ -103,6 +109,22 @@ class TaskRecovery {
|
|
|
103
109
|
type: import_constants.SCRIPT_INSTRUCTION_TYPE
|
|
104
110
|
},
|
|
105
111
|
required: true
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
association: "execution",
|
|
115
|
+
attributes: [],
|
|
116
|
+
where: {
|
|
117
|
+
status: import_plugin_workflow.EXECUTION_STATUS.STARTED,
|
|
118
|
+
[import_sequelize.Op.or]: [
|
|
119
|
+
{ expiresAt: null },
|
|
120
|
+
{
|
|
121
|
+
expiresAt: {
|
|
122
|
+
[import_sequelize.Op.gt]: now
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
required: true
|
|
106
128
|
}
|
|
107
129
|
],
|
|
108
130
|
order: [["id", "ASC"]],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-workflow-javascript",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.43",
|
|
4
4
|
"displayName": "Workflow: JavaScript",
|
|
5
5
|
"displayName.zh-CN": "工作流:JavaScript 节点",
|
|
6
6
|
"description": "Execute a piece of JavaScript in an isolated Node.js environment.",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"Workflow"
|
|
34
34
|
],
|
|
35
35
|
"license": "Apache-2.0",
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "7b133bbdf1a7ae7e7b42514f808e6d4fdf0e4a78"
|
|
37
37
|
}
|