Skip to content

Commit

Permalink
refactor: env
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Aug 28, 2024
1 parent e139f38 commit 0468755
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions internal/core/persistence/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {}
Expand Down

0 comments on commit 0468755

Please sign in to comment.