Skip to content

Commit

Permalink
asset repairer fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Sep 10, 2024
1 parent a4cd70a commit 8f73c56
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/config/fixer.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ func (c Config) repairer(ctx context.Context, db *sql.DB) {
panic(fmt.Errorf("%w: repairer", ErrPointer))
}
logger := helper.Logger(ctx)
if err := c.RepairAssets(ctx, db); err != nil {
logger.Errorf("asset repairs: %s", err)
}
if err := repairDatabase(ctx, db); err != nil {
if errors.Is(err, ErrVer) {
logger.Warnf("A %s, is the database server down?", ErrVer)
}
logger.Errorf("repair database could not initialize the database data: %s", err)
}
// repair assets should be run after the database has been repaired, as it may rely on database data.
if err := c.RepairAssets(ctx, db); err != nil {
logger.Errorf("asset repairs: %s", err)
}
}

// repairDatabase on startup checks the database connection and make any data corrections.
Expand Down

0 comments on commit 8f73c56

Please sign in to comment.