From b1b547c927db3f151de66f05bfb8976a0aaa596a Mon Sep 17 00:00:00 2001 From: Carsten Hollmann Date: Tue, 3 Aug 2021 08:35:39 +0200 Subject: [PATCH] Refactor delete all for admin user to delete all users and not the whole config --- .../org/n52/iceland/config/json/JsonAdminUserDao.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iceland/core/src/main/java/org/n52/iceland/config/json/JsonAdminUserDao.java b/iceland/core/src/main/java/org/n52/iceland/config/json/JsonAdminUserDao.java index efdecfa2d..b9bfff2c3 100644 --- a/iceland/core/src/main/java/org/n52/iceland/config/json/JsonAdminUserDao.java +++ b/iceland/core/src/main/java/org/n52/iceland/config/json/JsonAdminUserDao.java @@ -97,8 +97,13 @@ public void saveAdminUser(AdministratorUser user) { @Override public void deleteAll() { - this.configuration().delete(); + configuration().writeLock().lock(); + try { + getConfiguration().remove(JsonConstants.USERS); + configuration().scheduleWrite(); + } finally { + configuration().writeLock().unlock(); + } } - }