replace_edb_info.go 649 B

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