replace_edb_info.go 688 B

123456789101112131415161718192021222324
  1. package cache
  2. import (
  3. "eta/eta_api/models/data_manage"
  4. "eta/eta_api/utils"
  5. "fmt"
  6. )
  7. // 将替换指标操作加入到队列中
  8. func AddReplaceEdbInfo(oldEdbInfo, newEdbInfo *data_manage.EdbInfo) bool {
  9. record := new(data_manage.ReplaceEdbInfoItem)
  10. record.OldEdbInfo = oldEdbInfo
  11. record.NewEdbInfo = newEdbInfo
  12. if utils.Re == nil {
  13. err := utils.Rc.LPush(utils.CACHE_KEY_REPLACE_EDB, record)
  14. utils.FileLog.Info(fmt.Sprintf("指标替换 加入缓存 AddReplaceEdbInfo LPush: 旧指标ID:%d,新指标ID:%d", oldEdbInfo.EdbInfoId, newEdbInfo.EdbInfoId))
  15. if err != nil {
  16. fmt.Println("AddReplaceEdbInfo LPush Err:" + err.Error())
  17. }
  18. return true
  19. }
  20. return false
  21. }