@5minds/node-red-contrib-processcube 1.5.8-subscription-logging-a3f079-m42gnddb → 1.5.8-subscription-logging-21e444-m42honbj
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 +13 -1
- package/package.json +1 -1
package/externaltask-input.js
CHANGED
@@ -31,7 +31,7 @@ module.exports = function (RED) {
|
|
31
31
|
|
32
32
|
engineEventEmitter.on('engine-client-dispose', () => {
|
33
33
|
node.log('rm subsctiption');
|
34
|
-
engine.engineClient.externalTasks.removeSubscription(subscription, engine.identity);
|
34
|
+
// engine.engineClient.externalTasks.removeSubscription(subscription, engine.identity);
|
35
35
|
node.log('done rm subscriptions');
|
36
36
|
});
|
37
37
|
|
@@ -41,6 +41,14 @@ module.exports = function (RED) {
|
|
41
41
|
});
|
42
42
|
|
43
43
|
const register = async () => {
|
44
|
+
if (node.etw) {
|
45
|
+
try {
|
46
|
+
node.etw.stop();
|
47
|
+
node.log(`old etw closed: ${JSON.stringify(node.etw)}`);
|
48
|
+
} catch (e) {
|
49
|
+
node.log(`cant close etw: ${JSON.stringify(node.etw)}`);
|
50
|
+
}
|
51
|
+
}
|
44
52
|
node.log('registering node');
|
45
53
|
const client = engine.engineClient;
|
46
54
|
node.log(`subscribing to client: ${JSON.stringify(engine.engineClient)}`);
|
@@ -128,11 +136,14 @@ module.exports = function (RED) {
|
|
128
136
|
|
129
137
|
let options = RED.util.evaluateNodeProperty(config.workerConfig, 'json', node);
|
130
138
|
|
139
|
+
node.log('opening new subscription');
|
131
140
|
client.externalTasks
|
132
141
|
.subscribeToExternalTaskTopic(config.topic, etwCallback, options)
|
133
142
|
.then(async (externalTaskWorker) => {
|
134
143
|
node.status({ fill: 'blue', shape: 'ring', text: 'subcribed' });
|
135
144
|
|
145
|
+
node.etw = externalTaskWorker;
|
146
|
+
|
136
147
|
externalTaskWorker.identity = engine.identity;
|
137
148
|
engine.registerOnIdentityChanged((identity) => {
|
138
149
|
externalTaskWorker.identity = identity;
|
@@ -167,6 +178,7 @@ module.exports = function (RED) {
|
|
167
178
|
|
168
179
|
try {
|
169
180
|
externalTaskWorker.start();
|
181
|
+
node.log(`new etw started: ${JSON.stringify(externalTaskWorker)}`);
|
170
182
|
} catch (error) {
|
171
183
|
node.error(`Worker start 'externalTaskWorker.start' failed: ${error.message}`);
|
172
184
|
}
|
package/package.json
CHANGED