private fun purgeRelayLogs(wait: Boolean) { if (relayLogRetention > 1) { logger.info("Checking for old relay log files...") val logDir = File(binlogDir) val filesToPurge: Array<File> = FileCommands.filesOverRetentionAndInactive( logDir, binlogFilePattern, relayLogRetention, this.binlogPosition.getFileName() ) if (this.relayLogQueue != null) { for (fileToPurge in filesToPurge) { if (logger.isInfoEnabled()) { logger.debug("Removing relay log file from relay log queue: " + fileToPurge.getAbsolutePath()) } if (!relayLogQueue.remove(fileToPurge)) { logger.info("Unable to remove relay log file from relay log queue, probably old: $fileToPurge") } } } FileCommands.deleteFiles(filesToPurge, wait) } }
Purge old relay logs that have aged out past the number of retained files .