mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-11-25 03:15:19 +08:00
fix(plugin): use DataDir from flags for plugin manager initialization
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/OpenListTeam/OpenList/v4/cmd/flags"
|
||||
"github.com/OpenListTeam/OpenList/v4/internal/plugin"
|
||||
)
|
||||
|
||||
@@ -12,7 +13,7 @@ import (
|
||||
func InitPlugins() {
|
||||
// 2. 创建并初始化 Manager
|
||||
// "data" 目录应从配置中获取
|
||||
manager, err := plugin.NewManager(context.Background(), "data")
|
||||
manager, err := plugin.NewManager(context.Background(), flags.DataDir)
|
||||
if err != nil {
|
||||
// 在启动时,如果插件系统失败,应该 panic
|
||||
panic(fmt.Sprintf("Failed to initialize plugin manager: %v", err))
|
||||
|
||||
Reference in New Issue
Block a user