|
@@ -45,6 +45,7 @@ type trigger struct {
|
|
}
|
|
}
|
|
|
|
|
|
type cloudConfig struct {
|
|
type cloudConfig struct {
|
|
|
|
+ CleanBeforeStart bool `yaml:"clean-before-start"`
|
|
FullCollect bool `yaml:"full-collect"`
|
|
FullCollect bool `yaml:"full-collect"`
|
|
ConfigRefreshInterval int `yaml:"config-refresh-interval"` // 配置刷新时间间隔
|
|
ConfigRefreshInterval int `yaml:"config-refresh-interval"` // 配置刷新时间间隔
|
|
BagNumber int `yaml:"bag-number"`
|
|
BagNumber int `yaml:"bag-number"`
|
|
@@ -117,6 +118,11 @@ func InitCloudConfig() {
|
|
util.CreateDir(CloudConfig.BagCopyDir)
|
|
util.CreateDir(CloudConfig.BagCopyDir)
|
|
timeToLabelJson, _ := util.MapToJsonString(map[string]interface{}{"time": "label"})
|
|
timeToLabelJson, _ := util.MapToJsonString(map[string]interface{}{"time": "label"})
|
|
_ = util.WriteFile(timeToLabelJson, CloudConfig.TimeToLabelJsonPath)
|
|
_ = util.WriteFile(timeToLabelJson, CloudConfig.TimeToLabelJsonPath)
|
|
|
|
+
|
|
|
|
+ if CloudConfig.CleanBeforeStart { // 判断是否需要清空原数据缓存
|
|
|
|
+ _ = util.RemoveSubFiles(CloudConfig.BagDataDir)
|
|
|
|
+ _ = util.RemoveSubFiles(CloudConfig.BagCopyDir)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// RefreshCloudConfig 初始化业务配置
|
|
// RefreshCloudConfig 初始化业务配置
|