Skip to content

Commit

Permalink
fix drop task without finished flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kulukami committed Dec 2, 2024
1 parent 0970783 commit d368962
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion plugins/scanner/src/detector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,18 @@ impl Detector {
t.get_token(),
t.get_data()
);
let end_flag = ScanFinished {
data: "failed".to_string(),
error: format!(
"scanner task chan is full with {:?}",
task_sender.len()
),
};
if let Err(e) = r_client
.send_record(&end_flag.to_record_token(&t.get_token()))
{
warn!("send err, should exit : {:?}", e);
};
continue;
}
let task_map: HashMap<String, String> =
Expand All @@ -368,6 +380,11 @@ impl Detector {
data: "failed".to_string(),
error: format!("recv serde_json err {:?}", t.data),
};
if let Err(e) = r_client
.send_record(&end_flag.to_record_token(&t.get_token()))
{
warn!("send err, should exit : {:?}", e);
};
continue;
}
};
Expand Down Expand Up @@ -453,7 +470,7 @@ impl Detector {
};
break;
*/
warn!("walkdir err, should continue: {:?}", _err);
warn!("walkdir continue with: {:?}", _err);
continue
}
Some(Ok(entry)) => entry,
Expand Down

0 comments on commit d368962

Please sign in to comment.