diff --git a/backend/windmill-queue/src/jobs.rs b/backend/windmill-queue/src/jobs.rs index 9b9d767973..7b1e1fbd69 100644 --- a/backend/windmill-queue/src/jobs.rs +++ b/backend/windmill-queue/src/jobs.rs @@ -1692,10 +1692,10 @@ pub async fn pull( tracing::info!("Job '{}' from path '{}' with concurrency key '{}' has reached its concurrency limit of {} jobs run in the last {} seconds. This job will be re-queued for next execution at {}", job_uuid, job_script_path, job_custom_concurrent_limit, job_concurrency_key, job_custom_concurrency_time_window_s, estimated_next_schedule_timestamp); - let job_log_line_break = '\n'; let job_log_event = format!( - "Re-scheduled job to {estimated_next_schedule_timestamp} due to concurrency limits with key {job_concurrency_key} and limit {job_custom_concurrent_limit} in the last {job_custom_concurrency_time_window_s} seconds", + "\nRe-scheduled job to {estimated_next_schedule_timestamp} due to concurrency limits with key {job_concurrency_key} and limit {job_custom_concurrent_limit} in the last {job_custom_concurrency_time_window_s} seconds", ); + let _ = append_logs(job_uuid, pulled_job.workspace_id, job_log_event, db); if rsmq.is_some() { // if let Some(ref mut rsmq) = tx.rsmq { // if using redis, only one message at a time can be poped from the queue. Process only this message and move to the next elligible job @@ -1706,7 +1706,6 @@ pub async fn pull( SET running = false , started_at = null , scheduled_for = '{estimated_next_schedule_timestamp}' - , logs = CASE WHEN logs IS NULL OR logs = '' THEN '{job_log_event}'::text WHEN logs LIKE '%{job_log_event}' THEN logs ELSE concat(logs, '{job_log_line_break}{job_log_event}'::text) END WHERE id = '{job_uuid}' RETURNING tag" )) @@ -1729,7 +1728,6 @@ pub async fn pull( SET running = false , started_at = null , scheduled_for = '{estimated_next_schedule_timestamp}' - , logs = CASE WHEN logs IS NULL OR logs = '' THEN '{job_log_event}'::text WHEN logs LIKE '%{job_log_event}' THEN logs ELSE concat(logs, '{job_log_line_break}{job_log_event}'::text) END WHERE (id = '{job_uuid}') OR (script_path = '{job_script_path}' AND running = false AND scheduled_for <= now())" )) .fetch_all(&mut tx) diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index c980d59467..ffb8b49571 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -2716,15 +2716,6 @@ async fn handle_queued_job( #[cfg(feature = "prometheus")] timer.map(|x| x.stop_and_record()); } else { - if job.logs.as_ref().is_some_and(|x| !x.is_empty()) { - append_logs( - job.id, - job.workspace_id.clone(), - job.logs.clone().unwrap(), - db, - ) - .await; - } let mut logs = "".to_string(); let mut mem_peak: i32 = 0; let mut canceled_by: Option = None;