@icgio/icg-utils 1.7.31 → 1.7.33
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/constants/forex-rate.js +3 -3
- package/lib/influxdb.js +5 -4
- package/package.json +1 -1
package/constants/forex-rate.js
CHANGED
package/lib/influxdb.js
CHANGED
|
@@ -16,14 +16,14 @@ function fields_check(fields) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function check_points(points) {
|
|
19
|
-
|
|
19
|
+
points.filter((point) => {
|
|
20
20
|
if (fields_check(point.fields) && (!point.timestamp || point.timestamp instanceof Date)) {
|
|
21
|
-
return true
|
|
22
21
|
} else {
|
|
23
22
|
console.error('influx check_points', point)
|
|
24
23
|
return false
|
|
25
24
|
}
|
|
26
25
|
})
|
|
26
|
+
return true
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
module.exports = class Influx {
|
|
@@ -67,7 +67,8 @@ module.exports = class Influx {
|
|
|
67
67
|
} else {
|
|
68
68
|
this.bucket_exist = true
|
|
69
69
|
}
|
|
70
|
-
}
|
|
70
|
+
}
|
|
71
|
+
if (check_points(points)) {
|
|
71
72
|
points = points.map((p) => {
|
|
72
73
|
let p_temp = new Point(p.measurement)
|
|
73
74
|
for (let tag in p.tags) {
|
|
@@ -82,7 +83,7 @@ module.exports = class Influx {
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
if (p.timestamp) {
|
|
85
|
-
p_temp.timestamp(
|
|
86
|
+
p_temp.timestamp(p.timestamp)
|
|
86
87
|
}
|
|
87
88
|
return p_temp
|
|
88
89
|
})
|