fix: wait for the update check to finish instead of a fixed delay - #85
Conversation
`check-for-updates` runs asynchronously. The fixed `:delay 5s` races it and reports "Failed to check for new RouterOS version" whenever the check runs long. Poll for a terminal status instead, capped at 60 seconds.
|
Hey Markus! |
|
Hi Alexander, happy to check that - here are the results. Tested on RouterOS 6 long-term, on CHR and on real hardware Update check, measured against the old code on the same device:
The loop exited on its first read in both cases, so no extra wait I also ran a full |
|
Great! |
/system package update check-for-updatesruns asynchronously. The fixed:delay 5sraces it: on this fleet the check regularly needs longer, sostatusis stillfinding out latest version...when it is read, and the runaborts with
Failed to check for new RouterOS version.Poll for a terminal status instead, capped at 60 seconds. Keyed on the two END
states rather than the in-progress text, so an unknown status runs into the
timeout and is reported by the existing error branch instead of exiting early.
Verified on RouterOS 7.24 on CCR2004-16G-2S+, CRS328-24P-4S+, CRS312-4C+8XG and
a hAP ac, all in
osupdatemode.scriptVersiondeliberately left alone.