taskd.pl: avoid unnecessary 30s wait for throttle proceed
commit6fb1c301c61297002c89372d42cb62329060eae5
authorKyle J. McKay <mackyle@gmail.com>
Sun, 4 Oct 2015 23:43:50 +0000 (4 16:43 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Sun, 4 Oct 2015 23:43:50 +0000 (4 16:43 -0700)
tree6769ae7a75c9c004bd98959089ee2bea1013326a
parent04e1881218f4953f10a3fc5be99b26a53747f9bf
taskd.pl: avoid unnecessary 30s wait for throttle proceed

Switch from 'do {} until ()' to 'until () {}' so that all checks
are made before entering the 30s sleep-until-something-happens wait.

What can happen is that the proceed signal arrives before entering
the 'do {} until ()' loop causing an unnecessary 30s delay before
acting on it.  Switching to 'until () {}' does not completely
eliminate the problem as there will always be a race between testing
for the end conditions and entering the sleep-until-something-happens
before a signal comes in, but this change greatly reduces the
opportunity for it to happen.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
taskd/taskd.pl