@5minds/node-red-contrib-processcube 1.5.8-develop-cde510-m3r05cmh → 1.5.8-develop-77cb77-m3r2efaz

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,13 +18,6 @@ module.exports = function (RED) {
18
18
 
19
19
  const engine = RED.nodes.getNode(config.engine);
20
20
 
21
- const client = engine.engineClient;
22
-
23
- if (!client) {
24
- node.error('No engine configured.');
25
- return;
26
- }
27
-
28
21
  var eventEmitter = flowContext.get('emitter');
29
22
 
30
23
  if (!eventEmitter) {
@@ -32,7 +25,8 @@ module.exports = function (RED) {
32
25
  eventEmitter = flowContext.get('emitter');
33
26
  }
34
27
 
35
- const engineEventEmitter = node.engine.eventEmitter;
28
+ console.log('before', engine);
29
+ const engineEventEmitter = engine.eventEmitter;
36
30
 
37
31
  engineEventEmitter.on('engine-client-dispose', () => {
38
32
  node.engine.engineClient.externalTasks.removeSubscription(subscription, node.engine.identity);
@@ -44,6 +38,12 @@ module.exports = function (RED) {
44
38
  });
45
39
 
46
40
  const register = async () => {
41
+ const client = engine.engineClient;
42
+
43
+ if (!client) {
44
+ node.error('No engine configured.');
45
+ return;
46
+ }
47
47
  const etwCallback = async (payload, externalTask) => {
48
48
  const saveHandleCallback = (data, callback) => {
49
49
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.5.8-develop-cde510-m3r05cmh",
3
+ "version": "1.5.8-develop-77cb77-m3r2efaz",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {