diff options
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java')
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java index 7fde3310..ab9d3343 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java @@ -649,16 +649,18 @@ public class DbLecture { } } - public static void deleteOld(int minAgeDays) throws SQLException { + public static int deleteOld(int minAgeDays) throws SQLException { + int cnt = 0; try (MysqlConnection connection = Database.getConnection()) { MysqlStatement stmt = connection.prepareStatement("DELETE FROM lecture WHERE endtime < :cutoff"); stmt.setLong("cutoff", Util.unixTime() - TimeUnit.DAYS.toSeconds(minAgeDays)); - stmt.executeUpdate(); + cnt = stmt.executeUpdate(); connection.commit(); } catch (SQLException e) { LOGGER.error("Query failed in DbLecture.deleteOld()", e); throw e; } + return cnt; } public static List<LectureSummary> getLecturesUsingImageVersion(MysqlConnection connection, String imageVersionId) |