Skip to content

Commit

Permalink
Merge pull request #42 from Sense-Scape/41-feature-add-ability-to-sen…
Browse files Browse the repository at this point in the history
…d-systeminfo-chunks-from-adapter-to-ui-client

Feat: Adding ability to handle SystemInfo at adapter input
  • Loading branch information
Grabt234 authored Jul 31, 2024
2 parents 31862fc + 053544f commit 221084a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Routines/WSDataTxRoutine.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func RunChunkRoutingRoutine(loggingChannel chan map[zerolog.Level]string, incomi
var JSONData map[string]interface{}

if err := json.Unmarshal([]byte(strJSONData), &JSONData); err != nil {
loggingChannel <- CreateLogMessage(zerolog.ErrorLevel, "Error unmarshaling JSON in routing routine:"+err.Error())
loggingChannel <- CreateLogMessage(zerolog.ErrorLevel, "Error unmarshaling JSON in routing routine:"+err.Error()+" - Got " + strJSONData)
continue
}

Expand All @@ -76,7 +76,11 @@ func RunChunkRoutingRoutine(loggingChannel chan map[zerolog.Level]string, incomi
}

// And checking if it exists and trying to route it
chunkTypeRoutingMap.SendChunkToWebSocket(loggingChannel, chunkTypeStringKey, strJSONData, router)
if (chunkTypeStringKey == "SystemInfo") {
OutgoingReportingChannel <- string(strJSONData)
} else {
chunkTypeRoutingMap.SendChunkToWebSocket(loggingChannel, chunkTypeStringKey, strJSONData, router)
}
}

if time.Since(currentTime) > 1000*time.Millisecond {
Expand Down

0 comments on commit 221084a

Please sign in to comment.