From 3a3a8ba8b773d36a0b3c8208e37928e3c6dbe696 Mon Sep 17 00:00:00 2001 From: iximeow Date: Tue, 4 Jul 2023 01:52:55 -0700 Subject: pretty sure this gets host-preferential task assignment in place? --- src/main.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 0ca0765..0e94b96 100644 --- a/src/main.rs +++ b/src/main.rs @@ -256,14 +256,21 @@ async fn process_push_event(ctx: Arc, owner: String, repo: String, event: } }; + let repo_default_run_pref: Option = ctx.conn.lock().unwrap() + .query_row("select default_run_preference from repos where id=?1;", [repo_id], |row| { + Ok((row.get(0)).unwrap()) + }) + .optional() + .expect("can query"); + let pusher_email = pusher .get("email") .expect("has email") .as_str() .expect("is str"); - let job_id = ctx.new_job(remote_id, &sha, Some(pusher_email)).unwrap(); - let _ = ctx.new_run(job_id).unwrap(); + let job_id = ctx.new_job(remote_id, &sha, Some(pusher_email), repo_default_run_pref).unwrap(); + let _ = ctx.new_run(job_id, None).unwrap(); let notifiers = ctx.notifiers_by_repo(repo_id).expect("can get notifiers"); @@ -714,8 +721,8 @@ async fn handle_repo_summary(Path(path): Path, State(ctx): State elem, @@ -725,6 +732,8 @@ async fn handle_repo_summary(Path(path): Path, State(ctx): State