You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor job run monitoring to use struct with member methods (#3774)
## Changes
Replaced callback builder functions that returned closures capturing
stack pointers with a `jobRunMonitor` struct and a single `onProgress`
method.
The original code had three separate callback builders
(`pullRunIdCallback`, `logDebugCallback`, `logProgressCallback`) that
each returned closures with their own state, leading to pointer
manipulation on the stack and redundant state tracking.
Benefits:
- Single source of truth for run state (`prevState` tracked in one
place)
- Eliminated stack pointer manipulation
- Removed redundant logging (lifecycle state was logged twice)
## Why
I was looking into `libs/cmdio` and how we can refactor it. I suspect we
need to remove or refactor the progress logger to make further
abstraction possible (eg. turn it into a "widget" that is started and
stopped, like a spinner). Refactoring it is not possible without first
changing the only call site, which is this one.
## Tests
Tests pass. Manually performed a job run to
0 commit comments