replace_edb_info.go 728 B

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