測試: 用Jedis鏈接池工具,操做redis會報這樣的異常: ERR Background save already in progressjava
問題: 在Java的一個方法中,調用屢次redis的save或者bgsave持久化方法引發的redis
下面的第一個請求就不會有問題,第二個請求,就會報異常app
@GetMapping("/set1") public String set1() { redisPool.set("girl","一個女友"); redisPool.setEx("money","不少錢",10000); redisPool.hset("old-girl","一個老鴇","6號技師手活不錯"); redisPool.hsetEx("woman","一個女人","我不要",10000); redisPool.save(); return "OK"; } @GetMapping("/set2") public String set2() { redisPool.set("不想寫","不開空調"); redisPool.setEx("不想寫了","省錢?",10000); redisPool.save(); redisPool.hset("不想幹","沒避暑","就是不開"); redisPool.hsetEx("不想幹了","多少度了","沒空調?",10000); redisPool.save(); return "OK"; }
----------------------------------------工具