Use repeat_vars() more (#3133)

This commit is contained in:
Hocuri
2022-03-20 15:23:11 +01:00
committed by GitHub
parent a3ba19db96
commit 1e94ad25e1
3 changed files with 10 additions and 6 deletions

View File

@@ -472,9 +472,12 @@ pub async fn kill_action(context: &Context, action: Action) -> Result<()> {
/// Remove jobs with specified IDs.
async fn kill_ids(context: &Context, job_ids: &[u32]) -> Result<()> {
if job_ids.is_empty() {
return Ok(());
}
let q = format!(
"DELETE FROM jobs WHERE id IN({})",
job_ids.iter().map(|_| "?").collect::<Vec<&str>>().join(",")
sql::repeat_vars(job_ids.len())?
);
context
.sql