aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJason Song <i@wolfogre.com>2022-12-01 17:02:04 +0800
committerGitHub <noreply@github.com>2022-12-01 11:02:04 +0200
commit4e5d4d0073df7bffba95107ea969f1fdeb165830 (patch)
tree71d72380cf3f13b93e3e0f47af089f6c1fd136a3 /modules
parentb2c4870481329889a76ea2421152647d36dd8374 (diff)
downloadgitea-4e5d4d0073df7bffba95107ea969f1fdeb165830.tar.gz
gitea-4e5d4d0073df7bffba95107ea969f1fdeb165830.zip
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/storage/storage.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/storage/storage.go b/modules/storage/storage.go
index 35f1527172..671e0ce565 100644
--- a/modules/storage/storage.go
+++ b/modules/storage/storage.go
@@ -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