Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaoruntao committed Jun 21, 2023
1 parent 7c88f62 commit 4b54b27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/tasker/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ impl<T: DeserializeOwned + Send + Unpin + Sync + Clone + 'static, K: Serialize +
doc! {
"$match":{
"$and":[
{"task_state.worker_states":{"$exists":true}},
{
"$or":[
{ "task_option.min_worker_version": { "$exists": false } },
Expand All @@ -424,7 +425,7 @@ impl<T: DeserializeOwned + Send + Unpin + Sync + Clone + 'static, K: Serialize +
"$filter": {
"input": "$task_state.worker_states",
"as": "item",
"cond": { "$gt": vec!["$$item.ping_expire_time", "$$NOW"] }
"cond": { "$gt": ["$$item.ping_expire_time", "$$NOW"] }
}
}
}, "$task_option.concurrent_worker_cnt"]
Expand Down
2 changes: 1 addition & 1 deletion src/tasker/producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<T: Serialize, K: Serialize> TaskProducer<T, K> {
"key":key.as_ref(),
"task_state.create_time":now,
"task_state.start_time":start_time,
"task_state.worker_states":Bson::Array(vec![]),
"task_state.worker_states":[],
"task_option":to_document(&task_option).unwrap(),
},
};
Expand Down

0 comments on commit 4b54b27

Please sign in to comment.