From b2e2d74d01d8761606a888bc97ee76e54d05c357 Mon Sep 17 00:00:00 2001 From: Syfaro Date: Wed, 15 Dec 2021 16:06:37 -0500 Subject: [PATCH] Don't overwrite Faktory custom, set labels. --- fuzzysearch-common/src/faktory.rs | 5 ++++- fuzzysearch-common/src/lib.rs | 2 -- fuzzysearch-refresh/src/main.rs | 1 + fuzzysearch-webhook/src/main.rs | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fuzzysearch-common/src/faktory.rs b/fuzzysearch-common/src/faktory.rs index 7b77774..27eac2b 100644 --- a/fuzzysearch-common/src/faktory.rs +++ b/fuzzysearch-common/src/faktory.rs @@ -32,7 +32,10 @@ impl FaktoryClient { let faktory = self.faktory.clone(); tracing::trace!("Attempting to enqueue job"); - job.custom = get_faktory_custom(); + job.custom = get_faktory_custom() + .into_iter() + .chain(job.custom.into_iter()) + .collect(); tokio::task::spawn_blocking(move || { let mut faktory = faktory.lock().unwrap(); diff --git a/fuzzysearch-common/src/lib.rs b/fuzzysearch-common/src/lib.rs index 5bcb907..52ec2eb 100644 --- a/fuzzysearch-common/src/lib.rs +++ b/fuzzysearch-common/src/lib.rs @@ -1,8 +1,6 @@ #[cfg(feature = "queue")] pub mod faktory; pub mod types; -#[cfg(feature = "video")] -pub mod video; #[cfg(feature = "trace")] pub mod trace; diff --git a/fuzzysearch-refresh/src/main.rs b/fuzzysearch-refresh/src/main.rs index a51ac98..eb02c3e 100644 --- a/fuzzysearch-refresh/src/main.rs +++ b/fuzzysearch-refresh/src/main.rs @@ -30,6 +30,7 @@ fn main() { let rt = Arc::new(tokio::runtime::Runtime::new().unwrap()); let mut faktory = faktory::ConsumerBuilder::default(); + faktory.labels(vec!["fuzzysearch-refresh".to_string()]); faktory.workers(2); let p = Arc::new(Mutex::new(faktory::Producer::connect(None).unwrap_or_log())); diff --git a/fuzzysearch-webhook/src/main.rs b/fuzzysearch-webhook/src/main.rs index 9d2d6a2..edd3816 100644 --- a/fuzzysearch-webhook/src/main.rs +++ b/fuzzysearch-webhook/src/main.rs @@ -42,6 +42,7 @@ fn main() { .unwrap_or_log(); let mut faktory = faktory::ConsumerBuilder::default(); + faktory.labels(vec!["fuzzysearch-webhook".to_string()]); faktory.workers(2); let producer = std::sync::Mutex::new(faktory::Producer::connect(None).unwrap());