Skip to content

Commit

Permalink
fix: cache storage migration healthcheck result
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Dec 8, 2024
1 parent f01e014 commit 8e58613
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/storage/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ func NewFXModule(autoUpgrade bool) fx.Option {
ret := []fx.Option{
driver.NewFXModule(),
health.ProvideHealthCheck(func(driver *driver.Driver) health.NamedCheck {
hasReachedMinimalVersion := false
return health.NewNamedCheck(HealthCheckName, health.CheckFn(func(ctx context.Context) error {
isUpToDate, err := driver.HasReachMinimalVersion(ctx)
if hasReachedMinimalVersion {
return nil
}
var err error
hasReachedMinimalVersion, err = driver.HasReachMinimalVersion(ctx)
if err != nil {
return err
}
if !isUpToDate {
if !hasReachedMinimalVersion {
return errors.New("storage driver is not up to date")
}
return nil
Expand Down

0 comments on commit 8e58613

Please sign in to comment.