Go: add context to storage (#17690)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-08-03 15:08:21 +08:00
committed by GitHub
parent 2dbdaf951d
commit bddc941814
42 changed files with 634 additions and 527 deletions

View File

@@ -1226,7 +1226,8 @@ func (h *Handler) PingStore(c *gin.Context) {
return
}
if storageImpl.Health() {
ctx := c.Request.Context()
if storageImpl.Health(ctx) {
common.SuccessNoMessage(c, "SUCCESS")
} else {
common.ErrorWithCode(c, common.CodeServerError, "storage health check failed")

View File

@@ -1006,7 +1006,7 @@ func (s *Service) ListServices(ctx context.Context) ([]ServiceStatus, error) {
// storage engine
storageImpl := storage.GetStorageFactory().GetStorage()
storageHealth := storageImpl.Health()
storageHealth := storageImpl.Health(ctx)
if storageHealth {
results = append(results, newServiceStatus("storage_engine", storageImpl.Type(), "alive", time.Now(), ""))
} else {