Skip to content

Commit 1864efc

Browse files
refactor: Refactored agent core.db loading logic
1 parent 5d2084f commit 1864efc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

agent/init/db/db.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package db
22

33
import (
4+
"os"
45
"path"
56

67
"github.com/1Panel-dev/1Panel/agent/global"
@@ -14,7 +15,7 @@ func Init() {
1415
global.GPUMonitorDB = common.LoadDBConnByPath(path.Join(global.Dir.DbDir, "gpu_monitor.db"), "gpu_monitor")
1516
global.AlertDB = common.LoadDBConnByPath(path.Join(global.Dir.DbDir, "alert.db"), "alert")
1617

17-
if global.IsMaster {
18+
if _, err := os.Stat("/usr/bin/1panel-core"); err == nil {
1819
global.CoreDB = common.LoadDBConnByPath(path.Join(global.Dir.DbDir, "core.db"), "core")
1920
}
2021
}

0 commit comments

Comments
 (0)