Make checkpoint() method void (return value is not used)

master
François-Xavier Thomas 6 years ago
parent 8c46d39569
commit 7510b04efc
  1. 2
      airsonic-main/src/main/java/org/airsonic/player/dao/AbstractDao.java
  2. 4
      airsonic-main/src/main/java/org/airsonic/player/dao/DaoHelper.java
  3. 3
      airsonic-main/src/main/java/org/airsonic/player/dao/LegacyHsqlDaoHelper.java

@ -189,6 +189,6 @@ public class AbstractDao {
this.daoHelper = daoHelper;
}
public boolean checkpoint() { return daoHelper.checkpoint(); }
public void checkpoint() { daoHelper.checkpoint(); }
}

@ -52,8 +52,6 @@ public interface DaoHelper {
*
* Database checkpoints will make sure that the database is written on the disk
* and optimize on-disk storage.
*
* @return true if the checkpoint succeeded, false otherwise
*/
public default boolean checkpoint() { return false; }
public default void checkpoint() { }
}

@ -23,13 +23,12 @@ public class LegacyHsqlDaoHelper extends GenericDaoHelper {
}
@Override
public boolean checkpoint() {
public void checkpoint() {
// HSQLDB (at least version 1) does not handle automatic checkpoints very well by default.
// This makes sure the temporary log is actually written to more persistent storage.
LOG.info("Database checkpoint in progress...");
getJdbcTemplate().execute("CHECKPOINT DEFRAG");
LOG.info("Database checkpoint complete.");
return true;
}
@PreDestroy

Loading…
Cancel
Save