fix: use job timeout for snowflake timeout (#4240)

This commit is contained in:
HugoCasa
2024-08-14 14:27:43 +02:00
committed by GitHub
parent c09f078928
commit 3bd461ffa1

View File

@@ -17,7 +17,7 @@ use windmill_queue::{CanceledBy, HTTP_CLIENT};
use serde::{Deserialize, Serialize};
use crate::common::run_future_with_polling_update_job_poller;
use crate::common::{resolve_job_timeout, run_future_with_polling_update_job_poller};
use crate::{common::build_args_values, AuthedClientBackgroundTask};
#[derive(Serialize)]
@@ -304,7 +304,11 @@ pub async fn do_snowflake(
json!(database.database.unwrap().to_uppercase()),
);
}
body.insert("timeout".to_string(), json!(10)); // in seconds
let timeout = resolve_job_timeout(&db, &job.workspace_id, job.id, job.timeout)
.await
.0
.as_secs();
body.insert("timeout".to_string(), json!(timeout));
let queries = parse_sql_blocks(query);