account.go 617 B

1234567891011121314151617181920212223242526
  1. package service
  2. import (
  3. "context"
  4. "fmt"
  5. "go-common/app/job/main/member-cache/model"
  6. "go-common/library/log"
  7. )
  8. func notifyKey(mid int64) string {
  9. return fmt.Sprintf("MemberCacheJob-AccountNotify-T%d", mid)
  10. }
  11. // NotifyPurgeCache is
  12. func (s *Service) NotifyPurgeCache(ctx context.Context, mid int64, action string) {
  13. msg := &model.NotifyInfo{
  14. Mid: mid,
  15. Action: action,
  16. }
  17. key := notifyKey(mid)
  18. if err := s.accountNotify.Send(ctx, key, msg); err != nil {
  19. log.Error("Failed to notify to purge cache with msg: %+v: %+v", msg, err)
  20. }
  21. log.Info("Succeed to notify to purge cache with msg: %+v", msg)
  22. }