class PurgeService {

    public void runAutoPurge() {
        int daysBeforePurge = settings.getProperty(PurgeSettings.DAYS_BEFORE_REMOVE_PLAYER);
        if (!settings.getProperty(PurgeSettings.USE_AUTO_PURGE)) {
            return;
        } else if (daysBeforePurge <= 0) {
            ConsoleLogger.warning("Did not run auto purge: configured days before purging must be positive");
            return;
        }

        ConsoleLogger.info("Automatically purging the database...");
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, -daysBeforePurge);
        long until = calendar.getTimeInMillis();

        runPurge(null, until);
    }

      PurgeService();

}