Don't overwrite Faktory custom, set labels.

This commit is contained in:
Syfaro 2021-12-15 16:06:37 -05:00
parent 3e144828c8
commit b2e2d74d01
4 changed files with 6 additions and 3 deletions

View File

@ -32,7 +32,10 @@ impl FaktoryClient {
let faktory = self.faktory.clone(); let faktory = self.faktory.clone();
tracing::trace!("Attempting to enqueue job"); 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 || { tokio::task::spawn_blocking(move || {
let mut faktory = faktory.lock().unwrap(); let mut faktory = faktory.lock().unwrap();

View File

@ -1,8 +1,6 @@
#[cfg(feature = "queue")] #[cfg(feature = "queue")]
pub mod faktory; pub mod faktory;
pub mod types; pub mod types;
#[cfg(feature = "video")]
pub mod video;
#[cfg(feature = "trace")] #[cfg(feature = "trace")]
pub mod trace; pub mod trace;

View File

@ -30,6 +30,7 @@ fn main() {
let rt = Arc::new(tokio::runtime::Runtime::new().unwrap()); let rt = Arc::new(tokio::runtime::Runtime::new().unwrap());
let mut faktory = faktory::ConsumerBuilder::default(); let mut faktory = faktory::ConsumerBuilder::default();
faktory.labels(vec!["fuzzysearch-refresh".to_string()]);
faktory.workers(2); faktory.workers(2);
let p = Arc::new(Mutex::new(faktory::Producer::connect(None).unwrap_or_log())); let p = Arc::new(Mutex::new(faktory::Producer::connect(None).unwrap_or_log()));

View File

@ -42,6 +42,7 @@ fn main() {
.unwrap_or_log(); .unwrap_or_log();
let mut faktory = faktory::ConsumerBuilder::default(); let mut faktory = faktory::ConsumerBuilder::default();
faktory.labels(vec!["fuzzysearch-webhook".to_string()]);
faktory.workers(2); faktory.workers(2);
let producer = std::sync::Mutex::new(faktory::Producer::connect(None).unwrap()); let producer = std::sync::Mutex::new(faktory::Producer::connect(None).unwrap());