Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
quellen-sol committed Jul 10, 2024
1 parent a34b207 commit 1af48eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/plugin/src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ impl Sender {
Ok(producer)
}

async fn connect<'a>(
&'a self,
) -> Result<RwLockReadGuard<'a, Producer>, indexer_rabbitmq::Error> {
async fn connect(&self) -> Result<RwLockReadGuard<Producer>, indexer_rabbitmq::Error> {
let mut producer = self.producer.write().await;

if producer.chan.status().connected() {
Expand All @@ -109,6 +107,8 @@ impl Sender {
*producer =
Self::create_producer(&self.amqp, self.name.as_str(), self.startup_type).await?;

log::info!("Reconnected to AMQP server!");

// Release the write lock, by downgrading, and handing a read lock to the original caller,
// so they can send their message
let producer = producer.downgrade();
Expand Down Expand Up @@ -138,7 +138,7 @@ impl Sender {
{
// Drop the read lock. This thread is going to attempt to "promote" itself,
// and try to get a write lock to reconnect.
//
//
// This will also help allow a writer to grab the Producer if one's waiting
std::mem::drop(prod);

Expand Down

0 comments on commit 1af48eb

Please sign in to comment.