diff options
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index c4a7b6c..2343c88 100644 --- a/src/config.rs +++ b/src/config.rs | |||
| @@ -136,6 +136,18 @@ pub struct Config { | |||
| 136 | /// Primarily useful for testing that sync works without negentropy support. | 136 | /// Primarily useful for testing that sync works without negentropy support. |
| 137 | #[arg(long, env = "NGIT_SYNC_DISABLE_NEGENTROPY", default_value_t = false)] | 137 | #[arg(long, env = "NGIT_SYNC_DISABLE_NEGENTROPY", default_value_t = false)] |
| 138 | pub sync_disable_negentropy: bool, | 138 | pub sync_disable_negentropy: bool, |
| 139 | |||
| 140 | /// Hot cache duration in seconds for rejected announcements (default: 120 = 2 minutes) | ||
| 141 | /// Stores full event objects for immediate re-processing when dependencies resolve. | ||
| 142 | /// Too short (<30s): Miss events from slow relays | ||
| 143 | /// Too long (>5min): Waste memory | ||
| 144 | #[arg(long, env = "NGIT_REJECTED_HOT_CACHE_DURATION_SECS", default_value_t = 120)] | ||
| 145 | pub rejected_hot_cache_duration_secs: u64, | ||
| 146 | |||
| 147 | /// Cold index expiry in seconds for rejected announcements (default: 604800 = 7 days) | ||
| 148 | /// Stores metadata only to prevent repeated downloads of rejected events. | ||
| 149 | #[arg(long, env = "NGIT_REJECTED_COLD_INDEX_EXPIRY_SECS", default_value_t = 604800)] | ||
| 150 | pub rejected_cold_index_expiry_secs: u64, | ||
| 139 | } | 151 | } |
| 140 | 152 | ||
| 141 | impl Config { | 153 | impl Config { |
| @@ -258,6 +270,8 @@ impl Config { | |||
| 258 | sync_disconnect_check_interval_secs: 60, | 270 | sync_disconnect_check_interval_secs: 60, |
| 259 | sync_base_backoff_secs: 5, | 271 | sync_base_backoff_secs: 5, |
| 260 | sync_disable_negentropy: false, | 272 | sync_disable_negentropy: false, |
| 273 | rejected_hot_cache_duration_secs: 120, | ||
| 274 | rejected_cold_index_expiry_secs: 604800, | ||
| 261 | } | 275 | } |
| 262 | } | 276 | } |
| 263 | } | 277 | } |