diff --git a/src/filter/ztf.rs b/src/filter/ztf.rs index 6c4e45e2..7488177b 100644 --- a/src/filter/ztf.rs +++ b/src/filter/ztf.rs @@ -712,6 +712,13 @@ impl FilterWorker for ZtfFilterWorker { ) .await?; + // If we have output documents, we need to process them + // and create filter results for each document (which contain annotations) + // however, if the array is empty, there's nothing to do + if out_documents.is_empty() { + continue; + } + info!( "{}/{} ZTF alerts with programid {} passed filter {}", out_documents.len(), @@ -720,13 +727,6 @@ impl FilterWorker for ZtfFilterWorker { filter.id, ); - // If we have output documents, we need to process them - // and create filter results for each document (which contain annotations) - // however, if the array is empty, there's nothing to do - if out_documents.is_empty() { - continue; - } - let now_ts = chrono::Utc::now().timestamp_millis() as f64; for doc in out_documents {