@ejfdelgado/ejflab-back 1.16.2 → 1.16.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ejfdelgado/ejflab-back",
3
- "version": "1.16.2",
3
+ "version": "1.16.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ejfdelgado/ejflab-back.git"
@@ -18,7 +18,7 @@
18
18
  "license": "ISC",
19
19
  "private": false,
20
20
  "dependencies": {
21
- "@ejfdelgado/ejflab-common": "1.10.1",
21
+ "@ejfdelgado/ejflab-common": "1.10.3",
22
22
  "@google-cloud/compute": "^4.7.0",
23
23
  "@google-cloud/firestore": "^7.9.0",
24
24
  "@google-cloud/storage": "^7.11.3",
package/srv/MilvusSrv.mjs CHANGED
@@ -168,9 +168,13 @@ export class MilvusSrv {
168
168
  data
169
169
  } = decoded;
170
170
  await MilvusSrv.useDatabase(client, db_name, false);
171
+ let dataArray = data;
172
+ if (!(dataArray instanceof Array)) {
173
+ dataArray = [dataArray];
174
+ }
171
175
  await client.insert({
172
176
  collection_name: collection_name,
173
- data: data
177
+ data: dataArray
174
178
  });
175
179
  console.log("Milvus insert... OK");
176
180
  } catch (err) {
@@ -6,7 +6,7 @@ export class ProcessResponseProcessor extends GenericProcessor {
6
6
  super(context, io, socket);
7
7
  }
8
8
  async execute(args) {
9
- const { processorId, id, data } = args;
9
+ const { processorId, id, data, inputs } = args;
10
10
  let room = "";
11
11
  if (args.room) {
12
12
  room = args.room;
@@ -67,6 +67,13 @@ export class ProcessResponseProcessor extends GenericProcessor {
67
67
  //return;
68
68
  }
69
69
 
70
+ let isIndexed = false;
71
+ let indexN = null;
72
+ if (inputs instanceof Array && inputs.length > 0 && typeof inputs[0] == "number") {
73
+ isIndexed = true;
74
+ indexN = inputs[0];
75
+ }
76
+
70
77
  roomData.model.data = instance.getData();
71
78
  let countLocalChanges = 0;
72
79
  if (!!outputConnectionsConf) {
@@ -82,10 +89,15 @@ export class ProcessResponseProcessor extends GenericProcessor {
82
89
  return;
83
90
  }
84
91
  if (!outputParts[4]) {
92
+ // Byte case
85
93
  const processorIdLocal = outputParts[2];
86
94
  const sourcePath = outputParts[3];
87
- instance.saveBufferData(processorIdLocal, sourcePath, dataLocal);
88
- // Publish to others
95
+ let sourcePathIndexed = sourcePath;
96
+ if (isIndexed) {
97
+ sourcePathIndexed = sourcePathIndexed + "." + indexN;
98
+ }
99
+ instance.saveBufferData(processorIdLocal, sourcePathIndexed, dataLocal);
100
+ // Publish to others the not indexed?
89
101
  const destiny = `${room}.${output}`;
90
102
  //console.log(`Publishing to ${destiny} ok?`);
91
103
  this.io.to(destiny).emit("processResponse", {
@@ -94,11 +106,16 @@ export class ProcessResponseProcessor extends GenericProcessor {
94
106
  data: dataLocal
95
107
  });
96
108
  } else {
109
+ // Json case
97
110
  // Affect the model in the given point
98
111
  const path = outputParts[4];
99
- SimpleObj.recreate(roomData.model.data, path, dataLocal);
112
+ let pathIndexed = path;
113
+ if (isIndexed) {
114
+ pathIndexed = pathIndexed + "." + indexN;
115
+ }
116
+ SimpleObj.recreate(roomData.model.data, pathIndexed, dataLocal);
100
117
  countLocalChanges++;
101
- // Publish to others
118
+ // Publish to others the not indexed one?
102
119
  const destiny = `${room}.d.${path}`;
103
120
  //console.log(`Publishing to ${destiny} ok?`);
104
121
  this.io.to(destiny).emit("processResponse", {