public async Task CleanupOldMessages() { var deleteThresholdInstant = _clock.GetCurrentInstant() - CommandMessageRetention; var deleteThresholdSnowflake = DiscordUtils.InstantToSnowflake(deleteThresholdInstant); var deletedRows = await _db.Execute(conn => _repo.DeleteCommandMessagesBefore(conn, deleteThresholdSnowflake)); _logger.Information("Pruned {DeletedRows} command messages older than retention {Retention} (older than {DeleteThresholdInstant} / {DeleteThresholdSnowflake})", deletedRows, CommandMessageRetention, deleteThresholdInstant, deleteThresholdSnowflake); }
private async Task CleanupOldMessages() { var deleteThresholdInstant = SystemClock.Instance.GetCurrentInstant() - CommandMessageRetention; var deleteThresholdSnowflake = InstantToSnowflake(deleteThresholdInstant); var deletedRows = await _repo.DeleteCommandMessagesBefore(deleteThresholdSnowflake); _logger.Information( "Pruned {DeletedRows} command messages older than retention {Retention} (older than {DeleteThresholdInstant} / {DeleteThresholdSnowflake})", deletedRows, CommandMessageRetention, deleteThresholdInstant, deleteThresholdSnowflake); }