This mode-chooser is inverted: it returns "batch" when a user is
waiting (which needs low latency) and "realtime" when nothing waits
(wasting money). Fix line 3 so a waiting user gets realtime.
Expected output:
realtime
The break is on line 3 — but read the whole snippet first.