feat: load storages while starting
This commit is contained in:
16
server/middlewares/check.go
Normal file
16
server/middlewares/check.go
Normal file
@ -0,0 +1,16 @@
|
||||
package middlewares
|
||||
|
||||
import (
|
||||
"github.com/alist-org/alist/v3/internal/conf"
|
||||
"github.com/alist-org/alist/v3/server/common"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func StoragesLoaded(c *gin.Context) {
|
||||
if conf.StoragesLoaded {
|
||||
c.Next()
|
||||
} else {
|
||||
common.ErrorStrResp(c, "Loading storage, please wait", 500)
|
||||
c.Abort()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user