Conversation
wait time for insert and update
cracknel
left a comment
There was a problem hiding this comment.
Line 33 and 216 should keep official MQTT server address.
I guess you are trying to avoid some errors caused by rapidly writing to the DB?
You have not initialized maxRetries.
Personally I would use a random wait between 100 and 300ms. 100ms should be enough for previous database write to finish and will also keep the next writes at some distance from each other. Using a fixed wait will just pause the next writes and throw the same exception when you resume processing them.
A queue mechanism would be a better approach.
It solved my problem below:- 951 // create or update node in db 950 |
yes author can modify the line, that's just for my forked version |
wait time for insert and update