loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'feat: add optional storage init to doctor commands' (#3034) from viceice/forgejo:feat/doctor/add-init-storage-option into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3034
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>

+11
+11
services/doctor/doctor.go
··· 14 14 "code.gitea.io/gitea/modules/git" 15 15 "code.gitea.io/gitea/modules/log" 16 16 "code.gitea.io/gitea/modules/setting" 17 + "code.gitea.io/gitea/modules/storage" 17 18 ) 18 19 19 20 // Check represents a Doctor check ··· 25 26 AbortIfFailed bool 26 27 SkipDatabaseInitialization bool 27 28 Priority int 29 + InitStorage bool 28 30 } 29 31 30 32 func initDBSkipLogger(ctx context.Context) error { ··· 84 86 logger := log.BaseLoggerToGeneralLogger(&doctorCheckLogger{colorize: colorize}) 85 87 loggerStep := log.BaseLoggerToGeneralLogger(&doctorCheckStepLogger{colorize: colorize}) 86 88 dbIsInit := false 89 + storageIsInit := false 87 90 for i, check := range checks { 88 91 if !dbIsInit && !check.SkipDatabaseInitialization { 89 92 // Only open database after the most basic configuration check ··· 93 96 return nil 94 97 } 95 98 dbIsInit = true 99 + } 100 + if !storageIsInit && check.InitStorage { 101 + if err := storage.Init(); err != nil { 102 + logger.Error("Error whilst initializing the storage: %v", err) 103 + logger.Error("Check if you are using the right config file. You can use a --config directive to specify one.") 104 + return nil 105 + } 106 + storageIsInit = true 96 107 } 97 108 logger.Info("\n[%d] %s", i+1, check.Title) 98 109 if err := check.Run(ctx, loggerStep, autofix); err != nil {