allow multiple workers on agent mode (#5607)

This commit is contained in:
Ruben Fiszel
2025-04-11 21:19:29 +00:00
committed by GitHub
parent cdb0e42979
commit d5186da271
11 changed files with 176 additions and 93 deletions
+15
View File
@@ -5095,6 +5095,21 @@ async fn add_batch_jobs(
.execute(&mut *tx)
.await?;
sqlx::query!(
"INSERT INTO job_perms (job_id, email, username, is_admin, is_operator, folders, groups, workspace_id)
SELECT unnest($1::uuid[]), $2, $3, $4, $5, $6, $7, $8",
&uuids,
authed.email,
authed.username,
authed.is_admin,
authed.is_operator,
&[],
&[],
w_id,
)
.execute(&mut *tx)
.await?;
if let Some(flow_status) = flow_status {
sqlx::query!(
"INSERT INTO v2_job_status (id, flow_status)
+3 -3
View File
@@ -728,10 +728,10 @@ pub async fn run_server(
server.await?;
#[cfg(feature = "agent_worker_server")]
if let Some(bg_processor) = agent_workers_bg_processor {
tracing::info!("server off. shutting down agent workers bg processor");
for (i, bg_processor) in agent_workers_bg_processor.into_iter().enumerate() {
tracing::info!("server off. shutting down agent worker bg processor {i}");
bg_processor.await?;
tracing::info!("agent workers bg processor shut down");
tracing::info!("agent worker bg processor {i} shut down");
}
Ok(())
}