Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
fix: actually set the log interval from the config
Merged liw opened 1 year ago

Signed-off-by: Lars Wirzenius liw@liw.fi

2 files changed +5 -1 cadb933d b33aae59
modified src/bin/cib.rs
@@ -201,6 +201,7 @@ impl QueuedCmd {
            .events_rx(event_notifications.rx().map_err(CibError::notification)?)
            .run_tx(run_notifications.tx().map_err(CibError::notification)?)
            .db(db)
+
            .queue_len_interval(config.queue_len_interval)
            .broker(broker)
            .build()
            .map_err(CibError::process_queue)?;
@@ -286,6 +287,7 @@ impl ProcessEventsCmd {
            .events_rx(events_notification.rx().map_err(CibError::notification)?)
            .run_tx(run_notification.tx().map_err(CibError::notification)?)
            .db(args.open_db(config)?)
+
            .queue_len_interval(config.queue_len_interval)
            .broker(broker)
            .build()
            .map_err(CibError::process_queue)?;
modified src/queueproc.rs
@@ -119,7 +119,9 @@ impl QueueProcessor {

    fn pick_event(&mut self) -> Result<Option<QueuedCiEvent>, QueueError> {
        let ids = self.db.queued_ci_events().map_err(QueueError::db)?;
-
        if self.prev_queue_len.elapsed() > self.queue_len_interval {
+

+
        let elapsed = self.prev_queue_len.elapsed();
+
        if elapsed > self.queue_len_interval {
            logger::queueproc_queue_length(ids.len());
            self.prev_queue_len = Instant::now();
        }