From 046875513e90bbfe9c6853c68e10d354c516568a Mon Sep 17 00:00:00 2001 From: Yeuoly Date: Wed, 28 Aug 2024 23:41:37 +0800 Subject: [PATCH] refactor: env --- internal/core/persistence/init.go | 2 ++ internal/server/server.go | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/core/persistence/init.go b/internal/core/persistence/init.go index cad15a7..c570891 100644 --- a/internal/core/persistence/init.go +++ b/internal/core/persistence/init.go @@ -31,6 +31,8 @@ func InitPersistence(config *app.Config) { } else { log.Panic("Invalid persistence storage type: %s", config.PersistenceStorageType) } + + log.Info("Persistence initialized") } func GetPersistence() *Persistence { diff --git a/internal/server/server.go b/internal/server/server.go index fdcecfa..26d9eff 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -10,8 +10,8 @@ import ( "github.com/langgenius/dify-plugin-daemon/internal/utils/routine" ) -func (a *App) Run(config *app.Config) { - a.cluster = cluster.NewCluster(config) +func (app *App) Run(config *app.Config) { + app.cluster = cluster.NewCluster(config) // init routine pool routine.InitPool(config.RoutinePoolSize) @@ -23,16 +23,16 @@ func (a *App) Run(config *app.Config) { process.Init(config) // init plugin daemon - plugin_manager.InitGlobalPluginManager(a.cluster, config) + plugin_manager.InitGlobalPluginManager(app.cluster, config) // init persistence persistence.InitPersistence(config) // launch cluster - a.cluster.Launch() + app.cluster.Launch() // start http server - a.server(config) + app.server(config) // block select {}