|
@@ -29,11 +29,15 @@ func InitTriggerConfig() {
|
|
|
triggerLocalDir := config.CloudConfig.TriggersDir + id + "/"
|
|
|
hasLabelSo, soPaths := util.CheckSoFilesInDirectory(triggerLocalDir)
|
|
|
var triggerLocalPath string
|
|
|
- if hasIdDir && hasLabelSo { // 已存在的触发器不需要再次下载
|
|
|
+ if hasIdDir && hasLabelSo { // 已存在的触发器需要判断是否大小一致
|
|
|
triggerLocalPath = soPaths[0]
|
|
|
- c_log.GlobalLogger.Info("触发器插件 ", triggerLocalPath, " 存在。")
|
|
|
- triggerLocalPathsMapTriggerId[triggerLocalPath] = id
|
|
|
- continue
|
|
|
+ ossSize, _ := util.GetOSSFileSize(config.OssBucket, trigger.TriggerScriptPath)
|
|
|
+ localSize, _ := util.GetFileSize(triggerLocalPath)
|
|
|
+ if ossSize == localSize {
|
|
|
+ c_log.GlobalLogger.Info("触发器插件 ", triggerLocalPath, " 存在且与云端触发器大小一致。")
|
|
|
+ triggerLocalPathsMapTriggerId[triggerLocalPath] = id
|
|
|
+ continue
|
|
|
+ }
|
|
|
}
|
|
|
label := util.GetFileNameWithoutExtension(config.CloudConfig.TriggersDir + trigger.TriggerScriptPath)
|
|
|
triggerLocalPath = config.CloudConfig.TriggersDir + id + "/" + label + ".so"
|