diff --git a/SHiNE-server/shine-server-db/src/main/java/shine/db/dao/KeyRotationSessionsDAO.java b/SHiNE-server/shine-server-db/src/main/java/shine/db/dao/KeyRotationSessionsDAO.java index ab87eb33..7a41afa1 100644 --- a/SHiNE-server/shine-server-db/src/main/java/shine/db/dao/KeyRotationSessionsDAO.java +++ b/SHiNE-server/shine-server-db/src/main/java/shine/db/dao/KeyRotationSessionsDAO.java @@ -234,8 +234,10 @@ public final class KeyRotationSessionsDAO { } long now = System.currentTimeMillis(); - Long completed = next == KeyRotationStatus.COMPLETE ? now : current.getCompletedAtMs(); - Long aborted = next == KeyRotationStatus.ABORTED ? now : current.getAbortedAtMs(); + Long completed = current.getCompletedAtMs(); + if (next == KeyRotationStatus.COMPLETE) completed = now; + Long aborted = current.getAbortedAtMs(); + if (next == KeyRotationStatus.ABORTED) aborted = now; try (PreparedStatement ps = c.prepareStatement(""" UPDATE key_rotation_sessions