This commit is contained in:
parent
701f51a334
commit
860bd29ec2
@ -7,7 +7,7 @@ fun main() = runBlocking{
|
|||||||
GlobalScope.launch {
|
GlobalScope.launch {
|
||||||
val mqtt = MqttSubscriber()
|
val mqtt = MqttSubscriber()
|
||||||
mqtt.connect()
|
mqtt.connect()
|
||||||
val waitTime = System.getenv("WAITTIME").toLong() ?: 10000L
|
val waitTime = System.getenv("WAITTIME").toLong()
|
||||||
delay(waitTime)
|
delay(waitTime)
|
||||||
val resultMap = mqtt.disconnect()
|
val resultMap = mqtt.disconnect()
|
||||||
val resultProcessor = ProcessResults()
|
val resultProcessor = ProcessResults()
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
import java.time.ZoneId
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
||||||
|
|
||||||
class ProcessResults{
|
class ProcessResults {
|
||||||
var mapToProcess = LinkedHashMap<Int, Instant>()
|
var mapToProcess = LinkedHashMap<Int, Instant>()
|
||||||
private var formatter = SimpleDateFormat("yyyy-MM-dd_HH-mm-ss_SSS")
|
private var formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss_SSS")
|
||||||
|
.withZone(ZoneId.systemDefault())
|
||||||
|
|
||||||
|
|
||||||
fun process(){
|
fun process() {
|
||||||
for((id, instant) in this.mapToProcess){
|
println("Start processing results")
|
||||||
|
for ((id, instant) in this.mapToProcess) {
|
||||||
val currInstantString = formatter.format(instant)
|
val currInstantString = formatter.format(instant)
|
||||||
println("$id, $currInstantString")
|
println("$id, $currInstantString")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user