A decentralized music tracking and discovery platform built on AT Protocol 🎵

fix: improve reconnection logic for jetstream server with warning logging

+7 -7
+5 -4
crates/feed/src/feed.rs
··· 136 136 // loop, reconnecting on failure 137 137 loop { 138 138 match subscriber.run(ddb.clone()).await { 139 - Ok(_) => tracing::info!("Connected to jetstream server"), 139 + Ok(_) => {} 140 140 Err(e) => { 141 141 tracing::error!(error = %e, "Failed to connect to jetstream server, retrying in 1 second..."); 142 142 tokio::time::sleep(std::time::Duration::from_secs(1)).await; 143 143 continue; 144 144 } 145 145 } 146 - break; 146 + tracing::warn!( 147 + "Disconnected from jetstream server, reconnecting in 1 second..." 148 + ); 149 + tokio::time::sleep(std::time::Duration::from_secs(1)).await; 147 150 } 148 - 149 - Ok::<(), Error>(()) 150 151 }); 151 152 152 153 tokio::join!(feed_server.run(address), firehose_listener, sync_feed)
+2 -3
crates/jetstream/src/lib.rs
··· 41 41 continue; 42 42 } 43 43 } 44 - break; 44 + tracing::warn!("Disconnected from jetstream server, reconnecting in 1 second..."); 45 + tokio::time::sleep(std::time::Duration::from_secs(1)).await; 45 46 } 46 - 47 - Ok(()) 48 47 }