refactor(agent): fold post-refresh metrics push into the inline handler #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent-inline-garage-refresh"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The garage_refresh dispatch path had two string-compares to "garage_refresh" inside handle_command_request and two parallel post-success-metrics-push mechanisms (push_post_refresh_metrics for the inline path, post_success_hook for long-runners) that were structurally redundant.
This commit folds the inline path's full ceremony: collect, send result, pulse-log, push metrics on success - into handle_garage_refresh itself, so dispatch can early-return on that branch the same way it does for long-running commands. handle_garage_refresh's pure result-building step is exposed as a public collect_refresh_result for unit tests; push_post_refresh_metrics deletes.
One string-compare survives in dispatch (selecting the path); the trailing "is this still that special case?" tail-clause is gone. Net -10 lines, 1126/1126 tests pass, fitness and import-linter green.