|
@@ -7,7 +7,6 @@ import (
|
|
"cicv-data-closedloop/kinglong_msgs"
|
|
"cicv-data-closedloop/kinglong_msgs"
|
|
"plugin"
|
|
"plugin"
|
|
"strconv"
|
|
"strconv"
|
|
- "strings"
|
|
|
|
)
|
|
)
|
|
|
|
|
|
var (
|
|
var (
|
|
@@ -28,12 +27,8 @@ func InitTriggerConfig() {
|
|
c_log.GlobalLogger.Info("主节点加载触发器插件 - 开始。")
|
|
c_log.GlobalLogger.Info("主节点加载触发器插件 - 开始。")
|
|
// 下载所有触发器的文件
|
|
// 下载所有触发器的文件
|
|
for _, trigger := range config.PlatformConfig.TaskTriggers {
|
|
for _, trigger := range config.PlatformConfig.TaskTriggers {
|
|
- // 获取文件名
|
|
|
|
- pathSplit := strings.Split(trigger.TriggerScriptPath, "/")
|
|
|
|
- fileName := pathSplit[len(pathSplit)-1]
|
|
|
|
- // 下载
|
|
|
|
- triggerLocalPath := config.CloudConfig.TriggersDir + fileName
|
|
|
|
- util.CreateParentDir(triggerLocalPath)
|
|
|
|
|
|
+ triggerLocalPath := config.CloudConfig.TriggersDir + trigger.TriggerScriptPath
|
|
|
|
+ _ = util.CreateParentDir(triggerLocalPath)
|
|
c_log.GlobalLogger.Info("下载触发器插件从 ", trigger.TriggerScriptPath, " 到 ", triggerLocalPath)
|
|
c_log.GlobalLogger.Info("下载触发器插件从 ", trigger.TriggerScriptPath, " 到 ", triggerLocalPath)
|
|
config.OssMutex.Lock()
|
|
config.OssMutex.Lock()
|
|
err := config.OssBucket.GetObjectToFile(trigger.TriggerScriptPath, triggerLocalPath)
|
|
err := config.OssBucket.GetObjectToFile(trigger.TriggerScriptPath, triggerLocalPath)
|