Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
fix(src/queueproc.rs): always drop a picked event from queue
Lars Wirzenius committed 1 year ago
commit e17b467b3730789c1ba4eddd0ae60708abe83880
parent 11bb07d
1 file changed +7 -1
modified src/queueproc.rs
@@ -122,6 +122,13 @@ impl QueueProcessor {
        while !done {
            let mut first_error = None;
            while let Some(qe) = self.pick_event()? {
+
                // We always drop the picked event at once so that if
+
                // anything goes wrong, we don't try to process the
+
                // same event again. It's better for the failure to be
+
                // logged and let the humans deal with whatever
+
                // complicated failure situation is happening.
+
                self.drop_event(qe.id())?;
+

                match self.pick_adapters(qe.event()) {
                    Err(err) => {
                        if first_error.is_none() {
@@ -173,7 +180,6 @@ impl QueueProcessor {
            Err(QueueError::BuildTrigger(_, _)) => done = false,
            Err(err) => Err(err)?,
        }
-
        self.drop_event(qe.id())?;
        self.run_tx.notify()?;
        Ok(done)
    }