This commit is contained in:
narawat lamaiin
2025-03-22 09:41:39 +07:00
parent cb4d01c612
commit 840b0e6205
2 changed files with 18 additions and 22 deletions

View File

@@ -599,15 +599,8 @@ function sendReceiveMqttMsg(mqttInstance::mqttClientInstance_v2, receivechannel:
)::NamedTuple where {T<:Any}
timepass = nothing
attempts = 0
attempts = 1
while attempts <= maxattempt
attempts += 1
if attempts > 1
println("\n<sendReceiveMqttMsg()> attempts $attempts/$maxattempt ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
pprintln(outgoingMsg)
println("</sendReceiveMqttMsg()> attempts $attempts/$maxattempt ", @__FILE__, ":", @__LINE__, " $(Dates.now())\n")
end
sendMqttMsg(mqttInstance, outgoingMsg)
starttime = Dates.now()
@@ -632,6 +625,12 @@ function sendReceiveMqttMsg(mqttInstance::mqttClientInstance_v2, receivechannel:
end
sleep(1)
end
if attempts > 1
println("\n<sendReceiveMqttMsg()> attempts $attempts/$maxattempt ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
pprintln(outgoingMsg)
println("</sendReceiveMqttMsg()> attempts $attempts/$maxattempt ", @__FILE__, ":", @__LINE__, " $(Dates.now())\n")
end
attempts += 1
end
return (success=false,