From 2e83e56a078f5fcef7b995d875c3548313c6edf2 Mon Sep 17 00:00:00 2001
From: strawberry <strawberry@puppygock.gay>
Date: Mon, 3 Jun 2024 01:17:00 -0400
Subject: [PATCH] remove deleted config options and update `address` example
 option

Signed-off-by: strawberry <strawberry@puppygock.gay>
---
 conduwuit-example.toml | 19 +++++--------------
 src/core/config/mod.rs | 12 ------------
 2 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/conduwuit-example.toml b/conduwuit-example.toml
index 910ebe8f..1c6f56d4 100644
--- a/conduwuit-example.toml
+++ b/conduwuit-example.toml
@@ -77,11 +77,16 @@ database_backend = "rocksdb"
 # forwarded to the conduwuit instance running on this port
 # Docker users: Don't change this, you'll need to map an external port to this.
 # To listen on multiple ports, specify a vector e.g. [8080, 8448]
+#
+# default if unspecified is 8008
 port = 6167
 
 # default address (IPv4 or IPv6) conduwuit will listen on. Generally you want this to be
 # localhost (127.0.0.1 / ::1). If you are using Docker or a container NAT networking setup, you
 # likely need this to be 0.0.0.0.
+# To listen multiple addresses, specify a vector e.g. ["127.0.0.1", "::1"]
+#
+# default if unspecified is both IPv4 and IPv6 localhost: ["127.0.0.1", "::1"]
 address = "127.0.0.1"
 
 # Max request size for file uploads
@@ -375,15 +380,6 @@ allow_profile_lookup_federation_requests = true
 # Defaults to 256.0
 #db_cache_capacity_mb = 256.0
 
-# Interval in seconds when conduwuit will run database cleanup operations.
-#
-# For SQLite: this will flush the WAL by executing `PRAGMA wal_checkpoint(RESTART)` (https://www.sqlite.org/pragma.html#pragma_wal_checkpoint)
-# For RocksDB: this will run `flush_opt` to flush database memtables to SST files on disk (https://docs.rs/rocksdb/latest/rocksdb/struct.DBCommon.html#method.flush_opt)
-# These operations always run on shutdown.
-#
-# Defaults to 30 minutes (1800 seconds) to avoid IO amplification from too frequent cleanups
-#cleanup_second_interval = 1800
-
 
 ### RocksDB options
 
@@ -492,11 +488,6 @@ allow_profile_lookup_federation_requests = true
 # Defaults to 1 (TolerateCorruptedTailRecords)
 #rocksdb_recovery_mode = 1
 
-# Controls whether memory buffers are written to storage at the fixed interval set by `cleanup_period_interval`
-# even when they are not full. Setting this will increase load on the storage backplane and is never advised
-# under normal circumstances.
-#rocksdb_periodic_cleanup = false
-
 
 ### Domain Name Resolution and Caching
 
diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs
index 67b83975..6c2c9655 100644
--- a/src/core/config/mod.rs
+++ b/src/core/config/mod.rs
@@ -94,9 +94,6 @@ pub struct Config {
 	#[serde(default = "default_roomid_spacehierarchy_cache_capacity")]
 	pub roomid_spacehierarchy_cache_capacity: u32,
 
-	#[serde(default = "default_cleanup_second_interval")]
-	pub cleanup_second_interval: u32,
-
 	#[serde(default = "default_dns_cache_entries")]
 	pub dns_cache_entries: u32,
 	#[serde(default = "default_dns_min_ttl")]
@@ -249,8 +246,6 @@ pub struct Config {
 	#[serde(default)]
 	pub rocksdb_read_only: bool,
 	#[serde(default)]
-	pub rocksdb_periodic_cleanup: bool,
-	#[serde(default)]
 	pub rocksdb_compaction_prio_idle: bool,
 	#[serde(default = "true_fn")]
 	pub rocksdb_compaction_ioprio_idle: bool,
@@ -541,7 +536,6 @@ impl fmt::Display for Config {
 				"Roomid space hierarchy cache capacity",
 				&self.roomid_spacehierarchy_cache_capacity.to_string(),
 			),
-			("Cleanup interval in seconds", &self.cleanup_second_interval.to_string()),
 			("DNS cache entry limit", &self.dns_cache_entries.to_string()),
 			("DNS minimum TTL", &self.dns_min_ttl.to_string()),
 			("DNS minimum NXDOMAIN TTL", &self.dns_min_ttl_nxdomain.to_string()),
@@ -750,8 +744,6 @@ impl fmt::Display for Config {
 			#[cfg(feature = "rocksdb")]
 			("RocksDB Read-only Mode", &self.rocksdb_read_only.to_string()),
 			#[cfg(feature = "rocksdb")]
-			("RocksDB Periodic Cleanup", &self.rocksdb_periodic_cleanup.to_string()),
-			#[cfg(feature = "rocksdb")]
 			(
 				"RocksDB Compaction Idle Priority",
 				&self.rocksdb_compaction_prio_idle.to_string(),
@@ -929,10 +921,6 @@ fn default_stateinfo_cache_capacity() -> u32 { 100 }
 
 fn default_roomid_spacehierarchy_cache_capacity() -> u32 { 100 }
 
-fn default_cleanup_second_interval() -> u32 {
-	1800 // every 30 minutes
-}
-
 fn default_dns_cache_entries() -> u32 { 32768 }
 
 fn default_dns_min_ttl() -> u64 { 60 * 180 }