Обновил отправку тегов с массива на построчный формат

This commit is contained in:
Первов Артем
2026-06-22 02:48:23 +03:00
parent c4c2923f1f
commit de4d6eccbe
3 changed files with 30 additions and 10 deletions

View File

@@ -35,11 +35,13 @@ function toMetrics(values: number[], timestamp: number): Edge5ModbusMetric[] {
}
async function postMetrics(metrics: Edge5ModbusMetric[]): Promise<void> {
const response = await postCloudIngest(metrics)
for (const metric of metrics) {
const response = await postCloudIngest(metric)
if (!response.ok) {
const text = await response.text()
throw new Error(text)
if (!response.ok) {
const text = await response.text()
throw new Error(text)
}
}
console.log('edge5.modbus.posted', { count: metrics.length })