Skip to content

Commit

Permalink
Skip initing LFS storage if disabled (#21996)
Browse files Browse the repository at this point in the history
A complement to #21985.

I overlooked it because the name of the switch is `StartServer`, not
`Enabled`. I believe the weird name is a legacy, but renaming is out of
scope.
  • Loading branch information
wolfogre authored Dec 1, 2022
1 parent b2c4870 commit 4e5d4d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ func initAttachments() (err error) {
}

func initLFS() (err error) {
if !setting.LFS.StartServer {
LFS = discardStorage("LFS isn't enabled")
return nil
}
log.Info("Initialising LFS storage with type: %s", setting.LFS.Storage.Type)
LFS, err = NewStorage(setting.LFS.Storage.Type, &setting.LFS.Storage)
return err
Expand Down

0 comments on commit 4e5d4d0

Please sign in to comment.