@5minds/node-red-contrib-processcube 1.5.8-subscription-logging-21e444-m42honbj → 1.5.8-subscription-logging-20c391-m42k9luk
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/externaltask-input.js +1 -13
- package/package.json +1 -1
- package/processcube-engine-config.js +0 -12
package/externaltask-input.js
CHANGED
@@ -27,14 +27,6 @@ module.exports = function (RED) {
|
|
27
27
|
|
28
28
|
const engineEventEmitter = engine.eventEmitter;
|
29
29
|
|
30
|
-
node.log(`got event emmiter: ${JSON.stringify(engineEventEmitter)}`);
|
31
|
-
|
32
|
-
engineEventEmitter.on('engine-client-dispose', () => {
|
33
|
-
node.log('rm subsctiption');
|
34
|
-
// engine.engineClient.externalTasks.removeSubscription(subscription, engine.identity);
|
35
|
-
node.log('done rm subscriptions');
|
36
|
-
});
|
37
|
-
|
38
30
|
engineEventEmitter.on('engine-client-changed', () => {
|
39
31
|
node.log('new engineClient received');
|
40
32
|
register();
|
@@ -49,9 +41,7 @@ module.exports = function (RED) {
|
|
49
41
|
node.log(`cant close etw: ${JSON.stringify(node.etw)}`);
|
50
42
|
}
|
51
43
|
}
|
52
|
-
node.log('registering node');
|
53
44
|
const client = engine.engineClient;
|
54
|
-
node.log(`subscribing to client: ${JSON.stringify(engine.engineClient)}`);
|
55
45
|
|
56
46
|
if (!client) {
|
57
47
|
node.error('No engine configured.');
|
@@ -136,7 +126,6 @@ module.exports = function (RED) {
|
|
136
126
|
|
137
127
|
let options = RED.util.evaluateNodeProperty(config.workerConfig, 'json', node);
|
138
128
|
|
139
|
-
node.log('opening new subscription');
|
140
129
|
client.externalTasks
|
141
130
|
.subscribeToExternalTaskTopic(config.topic, etwCallback, options)
|
142
131
|
.then(async (externalTaskWorker) => {
|
@@ -178,7 +167,7 @@ module.exports = function (RED) {
|
|
178
167
|
|
179
168
|
try {
|
180
169
|
externalTaskWorker.start();
|
181
|
-
node
|
170
|
+
showStatus(node, Object.keys(started_external_tasks).length);
|
182
171
|
} catch (error) {
|
183
172
|
node.error(`Worker start 'externalTaskWorker.start' failed: ${error.message}`);
|
184
173
|
}
|
@@ -197,7 +186,6 @@ module.exports = function (RED) {
|
|
197
186
|
};
|
198
187
|
|
199
188
|
if (engine) {
|
200
|
-
node.log(`initial register: ${engine}`);
|
201
189
|
register();
|
202
190
|
}
|
203
191
|
}
|
package/package.json
CHANGED
@@ -40,7 +40,6 @@ module.exports = function (RED) {
|
|
40
40
|
};
|
41
41
|
|
42
42
|
function periodicallyRefreshEngineClient(node, n, intervalMs) {
|
43
|
-
node.log('starting refresh cycle');
|
44
43
|
function refreshUrl() {
|
45
44
|
const newUrl = RED.util.evaluateNodeProperty(n.url, n.urlType, node);
|
46
45
|
const newClientId = RED.util.evaluateNodeProperty(n.clientId, n.clientIdType, node);
|
@@ -51,42 +50,31 @@ module.exports = function (RED) {
|
|
51
50
|
node.credentials.clientId === newClientId &&
|
52
51
|
node.credentials.clientSecret === newClientSecret
|
53
52
|
) {
|
54
|
-
node.log('no new url found');
|
55
53
|
return;
|
56
54
|
}
|
57
55
|
|
58
|
-
node.log(`new url found: ${newUrl}`);
|
59
56
|
node.url = newUrl;
|
60
57
|
node.credentials.clientId = newClientId;
|
61
58
|
node.credentials.clientSecret = newClientSecret;
|
62
59
|
if (node.credentials.clientId && node.credentials.clientSecret) {
|
63
60
|
if (node.engineClient) {
|
64
|
-
node.log('disposing old engine client');
|
65
61
|
node.eventEmitter.emit('engine-client-dispose');
|
66
62
|
node.engineClient.dispose();
|
67
63
|
}
|
68
64
|
|
69
|
-
node.log('creating new engine client (without credentials)');
|
70
|
-
|
71
65
|
node.engineClient = new engine_client.EngineClient(node.url, () =>
|
72
66
|
getFreshIdentity(node.url, node)
|
73
67
|
);
|
74
68
|
|
75
|
-
node.log(`new engine client: ${JSON.stringify(node.engineClient)}`);
|
76
|
-
|
77
69
|
node.eventEmitter.emit('engine-client-changed');
|
78
70
|
} else {
|
79
71
|
if (node.engineClient) {
|
80
|
-
node.log('disposing old engine client (without credentials)');
|
81
72
|
node.eventEmitter.emit('engine-client-dispose');
|
82
73
|
node.engineClient.dispose();
|
83
74
|
}
|
84
75
|
|
85
|
-
node.log('creating new engine client (without credentials)');
|
86
76
|
node.engineClient = new engine_client.EngineClient(node.url);
|
87
77
|
|
88
|
-
node.log(`new engine client (without credentials): ${JSON.stringify(node.engineClient)}`);
|
89
|
-
|
90
78
|
node.eventEmitter.emit('engine-client-changed');
|
91
79
|
}
|
92
80
|
}
|