mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-14 09:44:45 +08:00
19 lines
535 B
Go
19 lines
535 B
Go
package db
|
|
|
|
import (
|
|
"path"
|
|
|
|
"github.com/1Panel-dev/1Panel/agent/global"
|
|
"github.com/1Panel-dev/1Panel/agent/utils/common"
|
|
)
|
|
|
|
func Init() {
|
|
global.DB = common.LoadDBConnByPath(path.Join(global.Dir.DbDir, "agent.db"), "agent")
|
|
global.TaskDB = common.LoadDBConnByPath(path.Join(global.Dir.DbDir, "task.db"), "task")
|
|
global.MonitorDB = common.LoadDBConnByPath(path.Join(global.Dir.DbDir, "monitor.db"), "monitor")
|
|
|
|
if global.IsMaster {
|
|
global.CoreDB = common.LoadDBConnByPath(path.Join(global.Dir.DbDir, "core.db"), "core")
|
|
}
|
|
}
|