Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c161d84fdf | ||
|
|
495b553285 | ||
|
|
21b770ba8b | ||
|
|
e9f94e0767 |
@@ -1 +1,2 @@
|
|||||||
* `global.yaml` - 全局配置
|
* `api.template.yaml` - API相关配置模板
|
||||||
|
* `cluster.template.yaml` - 通过集群自动接入节点模板
|
||||||
@@ -177,10 +177,15 @@ func (this *Manager) TotalDiskSize() int64 {
|
|||||||
this.locker.RLock()
|
this.locker.RLock()
|
||||||
defer this.locker.RUnlock()
|
defer this.locker.RUnlock()
|
||||||
|
|
||||||
total := int64(0)
|
var total = int64(0)
|
||||||
for _, storage := range this.storageMap {
|
for _, storage := range this.storageMap {
|
||||||
total += storage.TotalDiskSize()
|
total += storage.TotalDiskSize()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if total < 0 {
|
||||||
|
total = 0
|
||||||
|
}
|
||||||
|
|
||||||
return total
|
return total
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package teaconst
|
package teaconst
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version = "0.6.4"
|
Version = "0.6.4.2"
|
||||||
|
|
||||||
ProductName = "Edge Node"
|
ProductName = "Edge Node"
|
||||||
ProcessName = "edge-node"
|
ProcessName = "edge-node"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package teaconst
|
|||||||
import (
|
import (
|
||||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -15,7 +16,7 @@ var (
|
|||||||
|
|
||||||
NodeId int64 = 0
|
NodeId int64 = 0
|
||||||
NodeIdString = ""
|
NodeIdString = ""
|
||||||
IsMain = len(os.Args) == 1 || (len(os.Args) >= 2 && os.Args[1] == "pprof")
|
IsMain = checkMain()
|
||||||
|
|
||||||
GlobalProductName = nodeconfigs.DefaultProductName
|
GlobalProductName = nodeconfigs.DefaultProductName
|
||||||
|
|
||||||
@@ -24,3 +25,15 @@ var (
|
|||||||
|
|
||||||
DiskIsFast = false // 是否为高速硬盘
|
DiskIsFast = false // 是否为高速硬盘
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 检查是否为主程序
|
||||||
|
func checkMain() bool {
|
||||||
|
if len(os.Args) == 1 ||
|
||||||
|
(len(os.Args) >= 2 && os.Args[1] == "pprof") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
exe, _ := os.Executable()
|
||||||
|
return strings.HasSuffix(exe, ".test") ||
|
||||||
|
strings.HasSuffix(exe, ".test.exe") ||
|
||||||
|
strings.Contains(exe, "___")
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user