Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
heemankv committed Oct 10, 2024
1 parent 8de893e commit 576ede0
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions crates/orchestrator/src/database/mongodb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,45 +195,44 @@ impl Database for MongoDb {
},
// Stage 2: Lookup to find corresponding job_b_type jobs
doc! {
"$lookup": {
"from": "jobs",
"let": { "internal_id": "$internal_id" },
"pipeline": [
{
"$match": {
"$expr": {
"$and": [
{ "$eq": ["$job_type", job_b_type_bson] },
// Conditionally match job_b_status if provided
{ "$eq": ["$internal_id", "$$internal_id"] }
"$lookup": {
"from": "jobs",
"let": { "internal_id": "$internal_id" },
"pipeline": [
{
"$match": {
"$expr": {
"$and": [
{ "$eq": ["$job_type", job_b_type_bson] },
// Conditionally match job_b_status if provided
{ "$eq": ["$internal_id", "$$internal_id"] }
]
}
}
},
// TODO : Job B status code :
// // Add status matching if job_b_status is provided
// if let Some(status) = job_b_status {
// doc! {
// "$match": {
// "$expr": { "$eq": ["$status", status] }
// }
// }
// } else {
// doc! {}
// }
// ].into_iter().filter(|d| !d.is_empty()).collect::<Vec<_>>(),
],
"as": "successor_jobs"
}
},
// doc! {
// "$match": {
// "$expr": { "$eq": ["$status", status] }
// }
// }
// } else {
// doc! {}
// }
// ].into_iter().filter(|d| !d.is_empty()).collect::<Vec<_>>(),
],
"as": "successor_jobs"
}
},
// Stage 3: Filter out job_a_type jobs that have corresponding job_b_type jobs
doc! {
"$match": {
"successor_jobs": { "$eq": [] }
}
},
];

// TODO : Job B status code :
// // Conditionally add status matching for job_b_status
// if let Some(status) = job_b_status {
Expand Down

0 comments on commit 576ede0

Please sign in to comment.