Radish alpha
r
Radicle CI broker
Radicle
Git (anonymous pull)
Log in to clone via SSH
fix: drop pushing a shutdown event into queue, when node conn closes
Lars Wirzenius committed 1 year ago
commit 92bee78f7820ff5d176ad67e0f6b85dc3a7f59d5
parent 51a0834b7faeaa3c9fe651519081eb292798566a
2 files changed +0 -15
modified src/bin/cib.rs
@@ -196,7 +196,6 @@ impl ProcessEventsCmd {
            .events_tx(events_notification.tx())
            .db(args.open_db(config)?)
            .filters(&config.filters)
-
            .push_shutdown()
            .build()
            .map_err(CibError::QueueAdder)?;
        adder.add_events_in_thread();
modified src/queueadd.rs
@@ -15,7 +15,6 @@ use crate::{
pub struct QueueAdderBuilder {
    db: Option<Db>,
    filters: Option<Vec<EventFilter>>,
-
    push_shutdown: bool,
    events_tx: Option<NotificationSender>,
}

@@ -24,7 +23,6 @@ impl QueueAdderBuilder {
        Ok(QueueAdder {
            db: self.db.ok_or(AdderError::Missing("db"))?,
            filters: self.filters.ok_or(AdderError::Missing("filters"))?,
-
            push_shutdown: self.push_shutdown,
            events_tx: self.events_tx.ok_or(AdderError::Missing("events_tx"))?,
        })
    }
@@ -43,17 +41,11 @@ impl QueueAdderBuilder {
        self.filters = Some(filters.to_vec());
        self
    }
-

-
    pub fn push_shutdown(mut self) -> Self {
-
        self.push_shutdown = true;
-
        self
-
    }
}

pub struct QueueAdder {
    filters: Vec<EventFilter>,
    db: Db,
-
    push_shutdown: bool,
    events_tx: NotificationSender,
}

@@ -88,12 +80,6 @@ impl QueueAdder {
            }
        }

-
        // Add a shutdown event to the queue so that the queue
-
        // processing thread knows to stop.
-
        if self.push_shutdown {
-
            self.push_event(CiEvent::Shutdown)?;
-
        }
-

        logger::queueadd_end();
        Ok(())
    }