mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-11 12:56:10 +08:00
refactor: Refactored agent core.db loading logic
This commit is contained in:
parent
5d2084fda4
commit
1864efcd39
1 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package db
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/agent/global"
|
||||
|
|
@ -14,7 +15,7 @@ func Init() {
|
|||
global.GPUMonitorDB = common.LoadDBConnByPath(path.Join(global.Dir.DbDir, "gpu_monitor.db"), "gpu_monitor")
|
||||
global.AlertDB = common.LoadDBConnByPath(path.Join(global.Dir.DbDir, "alert.db"), "alert")
|
||||
|
||||
if global.IsMaster {
|
||||
if _, err := os.Stat("/usr/bin/1panel-core"); err == nil {
|
||||
global.CoreDB = common.LoadDBConnByPath(path.Join(global.Dir.DbDir, "core.db"), "core")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue