mirror of
https://gitee.com/ssssssss-team/magic-api.git
synced 2026-06-09 18:32:16 +08:00
修复集群环境下,修改接口名字可能未同步的BUG
This commit is contained in:
@@ -61,6 +61,7 @@ public class DatabaseResource extends KeyValueResource {
|
||||
|
||||
@Override
|
||||
public void readAll() {
|
||||
this.cachedContent.entrySet().removeIf(entry -> entry.getKey().startsWith(path));
|
||||
String sql = String.format("select file_path, file_content from %s where file_path like '%s%%'", tableName, this.path);
|
||||
SqlRowSet sqlRowSet = template.queryForRowSet(sql);
|
||||
while (sqlRowSet.next()) {
|
||||
|
||||
@@ -33,6 +33,7 @@ public class RedisResource extends KeyValueResource {
|
||||
public void readAll() {
|
||||
List<String> keys = new ArrayList<>(keys());
|
||||
List<String> values = redisTemplate.opsForValue().multiGet(keys);
|
||||
this.cachedContent.entrySet().removeIf(entry -> entry.getKey().startsWith(path));
|
||||
if (values != null) {
|
||||
for (int i = 0, size = keys.size(); i < size; i++) {
|
||||
this.cachedContent.put(keys.get(i), values.get(i));
|
||||
|
||||
Reference in New Issue
Block a user