pass language to completed job

This commit is contained in:
Ruben Fiszel
2022-08-25 14:55:38 +02:00
parent 88345a05e6
commit 84762df53b
2 changed files with 63 additions and 51 deletions
+59 -48
View File
@@ -1711,54 +1711,6 @@
"nullable": []
}
},
"84aa362a7f36f12efc1cddc24a124c0e6dff5adcc3f93dfa33a49725244d2e50": {
"query": "INSERT INTO completed_job as cj\n (workspace_id, id, parent_job, created_by, created_at, started_at, duration_ms, success, script_hash, script_path, args, result, logs, raw_code, canceled, canceled_by, canceled_reason, job_kind, schedule_path, permissioned_as, flow_status, raw_flow, is_flow_step, is_skipped)\n VALUES ($1, $2, $3, $4, $5, $6, EXTRACT(milliseconds FROM (now() - $6)), $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23)\n ON CONFLICT (id) DO UPDATE SET success = $7, result = $11, logs = concat(cj.logs, $12)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Varchar",
"Uuid",
"Uuid",
"Varchar",
"Timestamptz",
"Timestamptz",
"Bool",
"Int8",
"Varchar",
"Jsonb",
"Jsonb",
"Text",
"Text",
"Bool",
"Varchar",
"Text",
{
"Custom": {
"name": "job_kind",
"kind": {
"Enum": [
"script",
"preview",
"flow",
"dependencies",
"flowpreview",
"script_hub"
]
}
}
},
"Varchar",
"Varchar",
"Jsonb",
"Jsonb",
"Bool",
"Bool"
]
},
"nullable": []
}
},
"88a3f58a1a315200fdd2e4bb8638246ee21818f8aaaf56f6e9d7ddce1490d886": {
"query": "SELECT EXISTS(SELECT 1 FROM variable WHERE path = $1 AND workspace_id = $2)",
"describe": {
@@ -2492,6 +2444,65 @@
]
}
},
"b8a0f0cc7bb87300ebffe77d8fc2b08d336b0f36659fc4a83e579461fca72d65": {
"query": "INSERT INTO completed_job as cj\n (workspace_id, id, parent_job, created_by, created_at, started_at, duration_ms, success, script_hash, script_path, args, result, logs, raw_code, canceled, canceled_by, canceled_reason, job_kind, schedule_path, permissioned_as, flow_status, raw_flow, is_flow_step, is_skipped, language)\n VALUES ($1, $2, $3, $4, $5, $6, EXTRACT(milliseconds FROM (now() - $6)), $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24)\n ON CONFLICT (id) DO UPDATE SET success = $7, result = $11, logs = concat(cj.logs, $12)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Varchar",
"Uuid",
"Uuid",
"Varchar",
"Timestamptz",
"Timestamptz",
"Bool",
"Int8",
"Varchar",
"Jsonb",
"Jsonb",
"Text",
"Text",
"Bool",
"Varchar",
"Text",
{
"Custom": {
"name": "job_kind",
"kind": {
"Enum": [
"script",
"preview",
"flow",
"dependencies",
"flowpreview",
"script_hub"
]
}
}
},
"Varchar",
"Varchar",
"Jsonb",
"Jsonb",
"Bool",
"Bool",
{
"Custom": {
"name": "script_lang",
"kind": {
"Enum": [
"python3",
"deno"
]
}
}
}
]
},
"nullable": []
}
},
"bb56e61c7cfb09c0a28fb3226dfe91704c70d9fe15eda18e6889adfd7496f80b": {
"query": "DELETE FROM account WHERE workspace_id = $1 AND id = $2 RETURNING id",
"describe": {
+4 -3
View File
@@ -1319,9 +1319,9 @@ pub async fn add_completed_job(
(workspace_id, id, parent_job, created_by, created_at, started_at, duration_ms, success, \
script_hash, script_path, args, result, logs, \
raw_code, canceled, canceled_by, canceled_reason, job_kind, schedule_path, \
permissioned_as, flow_status, raw_flow, is_flow_step, is_skipped)
permissioned_as, flow_status, raw_flow, is_flow_step, is_skipped, language)
VALUES ($1, $2, $3, $4, $5, $6, EXTRACT(milliseconds FROM (now() - $6)), $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, \
$18, $19, $20, $21, $22, $23)
$18, $19, $20, $21, $22, $23, $24)
ON CONFLICT (id) DO UPDATE SET success = $7, result = $11, logs = concat(cj.logs, $12)",
queued_job.workspace_id,
queued_job.id,
@@ -1345,7 +1345,8 @@ pub async fn add_completed_job(
queued_job.flow_status,
queued_job.raw_flow,
queued_job.is_flow_step,
skipped
skipped,
queued_job.language: ScriptLang,
)
.execute(db)
.await