Skip to content

Commit 4e5d4d0

Browse files
authored
Skip initing LFS storage if disabled (#21996)
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.
1 parent b2c4870 commit 4e5d4d0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/storage/storage.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ func initAttachments() (err error) {
174174
}
175175

176176
func initLFS() (err error) {
177+
if !setting.LFS.StartServer {
178+
LFS = discardStorage("LFS isn't enabled")
179+
return nil
180+
}
177181
log.Info("Initialising LFS storage with type: %s", setting.LFS.Storage.Type)
178182
LFS, err = NewStorage(setting.LFS.Storage.Type, &setting.LFS.Storage)
179183
return err

0 commit comments

Comments
 (0)