可配置 tmpfs

This commit is contained in:
2021-05-26 15:47:25 +08:00
parent 3a2db11b06
commit d93da6aa09
7 changed files with 66 additions and 35 deletions

View File

@@ -677,7 +677,7 @@ type APIConfig struct {
FfmpegConfigs map[string]*FfmpegConfig `json:"ffmpeg_configs"`
}
func NewAPI(apiConfig APIConfig) (*API, error) {
func NewAPI(apiConfig APIConfig, tmpfsConfig tmpfs.TmpfsConfig) (*API, error) {
var err error
db, err := database.NewDatabase(apiConfig.DatabaseName)
@@ -696,7 +696,7 @@ func NewAPI(apiConfig APIConfig) (*API, error) {
},
APIConfig: apiConfig,
}
api.Tmpfs = tmpfs.NewTmpfs()
api.Tmpfs = tmpfs.NewTmpfs(tmpfsConfig)
// mount api
apiMux.HandleFunc("/hello", api.HandleOK)