Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/ofborg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c3c0ee723e1e
Choose a base ref
...
head repository: NixOS/ofborg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3b6947cd20a3
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Apr 30, 2020

  1. make messages persistent

    Should ensure we don't loose pending builds or evaluations when rabbitmq
    restarts.
    LnL7 committed Apr 30, 2020
    Copy the full SHA
    3223f32 View commit details
  2. Merge pull request #478 from LnL7/publish-persistent

    make messages persistent
    grahamc authored Apr 30, 2020
    Copy the full SHA
    3b6947c View commit details
Showing with 9 additions and 1 deletion.
  1. +7 −1 ofborg/src/easylapin.rs
  2. +1 −0 ofborg/src/notifyworker.rs
  3. +1 −0 ofborg/src/worker.rs
8 changes: 7 additions & 1 deletion ofborg/src/easylapin.rs
Original file line number Diff line number Diff line change
@@ -194,13 +194,19 @@ async fn action_deliver(
let key = msg.routing_key.take().unwrap_or_else(|| "".to_owned());
log::debug!("action publish {}", exch);

let mut props = BasicProperties::default().with_delivery_mode(2); // persistent.

if let Some(s) = msg.content_type {
props = props.with_content_type(s.into());
}

let _confirmaton = chan
.basic_publish(
&exch,
&key,
BasicPublishOptions::default(),
msg.content,
BasicProperties::default(),
props,
)
.await?
.await?;
1 change: 1 addition & 0 deletions ofborg/src/notifyworker.rs
Original file line number Diff line number Diff line change
@@ -82,6 +82,7 @@ impl<'a> NotificationReceiver for ChannelNotificationReceiver<'a> {

let props = BasicProperties {
content_type: msg.content_type,
delivery_mode: Some(2), // persistent
..Default::default()
};
self.channel
1 change: 1 addition & 0 deletions ofborg/src/worker.rs
Original file line number Diff line number Diff line change
@@ -104,6 +104,7 @@ impl<T: SimpleWorker + Send> amqp::Consumer for Worker<T> {

let props = BasicProperties {
content_type: msg.content_type,
delivery_mode: Some(2), // persistent
..Default::default()
};
channel