google / cabbie

A client side tool for managing the installation of Microsoft Windows updates on a device.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Interactive installs get blocked by waiting for service

discentem opened this issue · comments

commented

Running .\cabbie -debug install -all appears to wait for the default update interval. I'd expect the update to start immediately for an interactive run.

Screen Shot 2021-12-11 at 2 34 57 PM

Curiously, if it ctrl+c on the keyboard, Cabbie stops the service and proceeds immediately.
Screen Shot 2021-12-11 at 2 35 17 PM

Without looking through the code, my assumption is that this is due to the use of time.Ticker.

time.Ticker does not tick immediately, but instead waits the default interval, see the Go devs comment on this issue: golang/go#17601.

There are multiple ways to work around this, but the easiest is generally to force an initial tick, by calling a function, before the use of the ticker.

commented

Hey @TsekNet, my intention was actually to just get Cabbie to print info logs to stdout during interactive runs. After reviewing the code base, -debug does not seem like the correct way to do this.

Thus I submitted this PR #92. If you have time, please review and let me know what you think 😄

commented

fwiw: I dropped #92 in favor of #94