From a86c07d16aaff9bc532b934db01150e616a3aa90 Mon Sep 17 00:00:00 2001 From: tangyang9464 Date: Wed, 29 Sep 2021 18:51:55 +0800 Subject: [PATCH] fix: savePolicy repeat save Signed-off-by: tangyang9464 --- .github/workflows/maven-ci.yml | 2 +- src/main/java/org/casbin/adapter/RedisAdapter.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index 3a5cf1f..1aa1bd3 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -43,7 +43,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v1 with: - node-version: 12 + node-version: 14 - name: Sematic Release run: | diff --git a/src/main/java/org/casbin/adapter/RedisAdapter.java b/src/main/java/org/casbin/adapter/RedisAdapter.java index 243c00f..4b82fb9 100644 --- a/src/main/java/org/casbin/adapter/RedisAdapter.java +++ b/src/main/java/org/casbin/adapter/RedisAdapter.java @@ -67,6 +67,7 @@ public void loadPolicy(Model model) { */ @Override public void savePolicy(Model model) { + jedis.del(this.key); extracted(model, "p"); extracted(model, "g"); }