Use app.driver.Stat for registry health check

`app.driver.List` on `"/"` is very expensive if registry contains significant amount of images. And the result isn't used anyways.
In most (if not all) storage drivers, `Stat` has a cheaper implementation, so use it instead to achieve the same goal.

Signed-off-by: yixi zhang <yixi@memsql.com>
This commit is contained in:
yixi zhang
2016-12-20 22:21:29 -08:00
parent 2d500932f2
commit 8e915d69f4
2 changed files with 2 additions and 2 deletions

View File

@@ -345,7 +345,7 @@ func (app *App) RegisterHealthChecks(healthRegistries ...*health.Registry) {
}
storageDriverCheck := func() error {
_, err := app.driver.List(app, "/") // "/" should always exist
_, err := app.driver.Stat(app, "/") // "/" should always exist
return err // any error will be treated as failure
}