housekeeping: Add housekeeping middleware
This MR adds HousekeepingMiddleware which intercepts gRPC requests, independent of whether transactions are enabled. The scheduler:
- decides whether to invoke
OptimizeRepositorybased on a configurable housekeeping interval. - ensures only a single
OptimizeRepositoryjob is executing concurrently.
The middleware is guarded behind a new feature flag in case it results in performance degradation. If the middleware encounters errors, they are logged and the handler is invoked immediately, short-circuiting the middleware logic.
Edited by James Liu