golang 的 rabbitmq 消费项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 rivejä
996 B

  1. package utils
  2. import (
  3. "applet/app/cfg"
  4. "applet/app/utils/cache"
  5. "fmt"
  6. "github.com/gin-gonic/gin"
  7. )
  8. func ClearRedis(c *gin.Context) {
  9. var str = []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
  10. key := fmt.Sprintf("%s:cfg_cache", c.GetString("mid"))
  11. cache.Del(key)
  12. key2 := fmt.Sprintf("%s:virtual_coin_cfg", c.GetString("mid"))
  13. cache.Del(key2)
  14. key3 := fmt.Sprintf("%s:virtual_coin_cfg_comm", c.GetString("mid"))
  15. cache.Del(key3)
  16. for _, v := range str {
  17. key1 := fmt.Sprintf("%s:cfg_cache:%s", c.GetString("mid"), v)
  18. cache.Del(key1)
  19. }
  20. if cfg.Prd == false {
  21. key := fmt.Sprintf("%s:cfg_cache", "22255132")
  22. cache.Del(key)
  23. key2 := fmt.Sprintf("%s:virtual_coin_cfg", "22255132")
  24. cache.Del(key2)
  25. key3 := fmt.Sprintf("%s:virtual_coin_cfg_comm", "22255132")
  26. cache.Del(key3)
  27. for _, v := range str {
  28. key1 := fmt.Sprintf("%s:cfg_cache:%s", "22255132", v)
  29. cache.Del(key1)
  30. }
  31. }
  32. }