Noreposts Feed

Remove deprecated admin script

Follows should persist until user unfollows - they don't have a TTL.
Only posts should be cleaned up after 48 hours.

This fixes the issue where the cleanup task was deleting millions of
follows every 5 minutes, causing the feed to appear empty.

+1 -19
-14
src/database.rs
··· 148 148 Ok(()) 149 149 } 150 150 151 - pub async fn cleanup_old_follows(&self, hours: i64) -> Result<()> { 152 - let cutoff = Utc::now() - chrono::Duration::hours(hours); 153 - let result = sqlx::query("DELETE FROM follows WHERE indexed_at < ?") 154 - .bind(cutoff.to_rfc3339()) 155 - .execute(&self.pool) 156 - .await?; 157 - 158 - let deleted = result.rows_affected(); 159 - if deleted > 0 { 160 - tracing::info!("Cleaned up {} follows older than {} hours", deleted, hours); 161 - } 162 - Ok(()) 163 - } 164 - 165 151 pub async fn record_feed_request(&self, user_did: &str) -> Result<()> { 166 152 sqlx::query( 167 153 r#"
+1 -5
src/main.rs
··· 123 123 warn!("Failed to cleanup old posts: {}", e); 124 124 } 125 125 126 - // Clean up old follows (older than 48 hours) 127 - if let Err(e) = db_cleanup.cleanup_old_follows(48).await { 128 - warn!("Failed to cleanup old follows: {}", e); 129 - } 130 - 131 126 // Verify follows for active users (accessed feed in last 7 days) 127 + // This removes follows that no longer exist in the user's actual follow list 132 128 if let Err(e) = cleanup::verify_active_user_follows(Arc::clone(&db_cleanup)).await { 133 129 warn!("Failed to verify active user follows: {}", e); 134 130 }