mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-09 00:04:10 +00:00
fix: add ack deadline gcp (#6625)
* update ref * add ack deadline * update ref
This commit is contained in:
+4
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n UPDATE \n gcp_trigger \n SET \n gcp_resource_path = $1,\n subscription_id = $2,\n topic_id = $3,\n delivery_type = $4,\n delivery_config = $5,\n is_flow = $6, \n edited_by = $7, \n email = $8,\n script_path = $9,\n path = $10,\n enabled = $11,\n edited_at = now(), \n error = NULL,\n server_id = NULL,\n error_handler_path = $14,\n error_handler_args = $15,\n retry = $16,\n auto_acknowledge_msg = $17\n WHERE \n workspace_id = $12 AND \n path = $13\n ",
|
||||
"query": "\n UPDATE \n gcp_trigger \n SET \n gcp_resource_path = $1,\n subscription_id = $2,\n topic_id = $3,\n delivery_type = $4,\n delivery_config = $5,\n is_flow = $6, \n edited_by = $7, \n email = $8,\n script_path = $9,\n path = $10,\n enabled = $11,\n edited_at = now(), \n error = NULL,\n server_id = NULL,\n error_handler_path = $14,\n error_handler_args = $15,\n retry = $16,\n auto_acknowledge_msg = $17,\n ack_deadline = $18\n WHERE \n workspace_id = $12 AND \n path = $13\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
@@ -31,10 +31,11 @@
|
||||
"Varchar",
|
||||
"Jsonb",
|
||||
"Jsonb",
|
||||
"Bool"
|
||||
"Bool",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "1a9ba16c90d3d65c4ff39aaddb3079009e03af711e7f6b53332537cf4cb0e8dd"
|
||||
"hash": "17ca259e1c78e1317fdd19436e15bef428fc4f0d52776d7a5fca64f17225ef30"
|
||||
}
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n INSERT INTO gcp_trigger (\n gcp_resource_path,\n subscription_id,\n topic_id,\n delivery_type,\n delivery_config,\n workspace_id, \n path, \n script_path, \n is_flow, \n email, \n enabled, \n edited_by,\n error_handler_path,\n error_handler_args,\n retry,\n auto_acknowledge_msg\n ) \n VALUES (\n $1, \n $2, \n $3, \n $4,\n $5,\n $6, \n $7, \n $8, \n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16\n )",
|
||||
"query": "\n INSERT INTO gcp_trigger (\n gcp_resource_path,\n subscription_id,\n topic_id,\n delivery_type,\n delivery_config,\n workspace_id, \n path, \n script_path, \n is_flow, \n email, \n enabled, \n edited_by,\n error_handler_path,\n error_handler_args,\n retry,\n auto_acknowledge_msg,\n ack_deadline\n ) \n VALUES (\n $1, \n $2, \n $3, \n $4,\n $5,\n $6, \n $7, \n $8, \n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16,\n $17\n )",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
@@ -30,10 +30,11 @@
|
||||
"Varchar",
|
||||
"Jsonb",
|
||||
"Jsonb",
|
||||
"Bool"
|
||||
"Bool",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "e619fa013528a6275f98e14ae1727c55b0d4f4a5e4ee87c29251042e2916f0a0"
|
||||
"hash": "e7c61bbdcf882f6e1e9b11df03e7a2ee318c72b365c0fe0b9fbec886a461f5e4"
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
08f610ecc5486ad2568e0abd22405baa90a93481
|
||||
89ecae7db8c46cfc571eb58bcd7f4ba6f78e8aba
|
||||
@@ -0,0 +1,2 @@
|
||||
-- Add down migration script here
|
||||
ALTER TABLE gcp_trigger DROP COLUMN ack_deadline;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- Add up migration script here
|
||||
ALTER TABLE gcp_trigger ADD COLUMN ack_deadline INTEGER;
|
||||
@@ -16818,6 +16818,12 @@ components:
|
||||
type: boolean
|
||||
auto_acknowledge_msg:
|
||||
type: boolean
|
||||
ack_deadline:
|
||||
type: integer
|
||||
format: int32
|
||||
minimum: 10
|
||||
maximum: 600
|
||||
description: "Time in seconds within which the message must be acknowledged. If not provided, defaults to the subscription's acknowledgment deadline (600 seconds)."
|
||||
error_handler_path:
|
||||
type: string
|
||||
error_handler_args:
|
||||
|
||||
@@ -183,6 +183,7 @@ pub struct GcpTriggerConfig {
|
||||
pub create_update: Option<CreateUpdateConfig>,
|
||||
pub topic_id: String,
|
||||
pub auto_acknowledge_msg: Option<bool>,
|
||||
pub ack_deadline: Option<i32>,
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "enterprise", feature = "nats", feature = "private"))]
|
||||
@@ -397,6 +398,7 @@ async fn set_gcp_trigger_config(
|
||||
gcp_config.create_update,
|
||||
false,
|
||||
capture_config.is_flow,
|
||||
gcp_config.ack_deadline
|
||||
)
|
||||
.await?;
|
||||
gcp_config.create_update = Some(config);
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
cloud_subscription_id?: string
|
||||
create_update_subscription_id?: string
|
||||
auto_acknowledge_msg: boolean
|
||||
ack_deadline?: number
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -97,6 +98,7 @@
|
||||
subscription_mode = $bindable('create_update'),
|
||||
base_endpoint = $bindable(getBaseUrl()),
|
||||
auto_acknowledge_msg = $bindable(true),
|
||||
ack_deadline = $bindable(),
|
||||
path = '',
|
||||
showTestingBadge = false,
|
||||
cloud_subscription_id = $bindable(''),
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
let deploymentLoading = $state(false)
|
||||
let base_endpoint = $derived(`${window.location.origin}${base}`)
|
||||
let auto_acknowledge_msg = $state(true)
|
||||
let ack_deadline: number | undefined = $state()
|
||||
let optionTabSelected: 'settings' | 'error_handler' | 'retries' = $state('error_handler')
|
||||
let errorHandlerSelected: ErrorHandler = $state('slack')
|
||||
let error_handler_path: string | undefined = $state()
|
||||
@@ -151,6 +152,7 @@
|
||||
error_handler_args = defaultValues?.error_handler_args ?? {}
|
||||
retry = defaultValues?.retry ?? undefined
|
||||
auto_acknowledge_msg = defaultValues?.auto_acknowledge_msg ?? true
|
||||
ack_deadline = defaultValues?.ack_deadline
|
||||
errorHandlerSelected = getHandlerType(error_handler_path ?? '')
|
||||
} finally {
|
||||
drawerLoading = false
|
||||
@@ -191,6 +193,7 @@
|
||||
error_handler_args = cfg?.error_handler_args ?? {}
|
||||
retry = cfg?.retry
|
||||
auto_acknowledge_msg = cfg?.auto_acknowledge_msg ?? true
|
||||
ack_deadline = cfg?.ack_deadline
|
||||
errorHandlerSelected = getHandlerType(error_handler_path ?? '')
|
||||
}
|
||||
|
||||
@@ -230,7 +233,8 @@
|
||||
error_handler_path,
|
||||
error_handler_args,
|
||||
retry,
|
||||
auto_acknowledge_msg
|
||||
auto_acknowledge_msg,
|
||||
ack_deadline
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,6 +247,7 @@
|
||||
delivery_config,
|
||||
base_endpoint,
|
||||
auto_acknowledge_msg,
|
||||
ack_deadline,
|
||||
topic_id,
|
||||
path
|
||||
}
|
||||
@@ -400,6 +405,7 @@
|
||||
bind:topic_id
|
||||
bind:subscription_mode
|
||||
bind:auto_acknowledge_msg
|
||||
bind:ack_deadline
|
||||
{path}
|
||||
cloud_subscription_id={subscription_id}
|
||||
create_update_subscription_id={subscription_id}
|
||||
@@ -439,6 +445,27 @@
|
||||
</div>
|
||||
{/if}
|
||||
</Subsection>
|
||||
<Subsection
|
||||
label="Acknowledgment deadline"
|
||||
tooltip="Time in seconds within which the message must be acknowledged. If not provided, defaults to the subscription's acknowledgment deadline (600 seconds). Range: 10-600 seconds."
|
||||
>
|
||||
<div class="mt-2">
|
||||
<input
|
||||
type="number"
|
||||
bind:value={ack_deadline}
|
||||
disabled={!can_write}
|
||||
min="10"
|
||||
max="600"
|
||||
step="1"
|
||||
placeholder="600"
|
||||
class="w-full px-3 py-2 text-sm border border-gray-200 dark:border-gray-700 rounded-md bg-surface text-primary focus:ring-2 focus:ring-blue-500 focus:border-blue-500 disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
/>
|
||||
</div>
|
||||
<div class="mt-2 text-xs text-secondary">
|
||||
Leave empty to use subscription default (600 seconds). This affects how long
|
||||
messages remain in flight before being redelivered.
|
||||
</div>
|
||||
</Subsection>
|
||||
{:else}
|
||||
<div class="flex items-center justify-center h-32 text-tertiary">
|
||||
No settings available for push delivery type
|
||||
|
||||
@@ -31,6 +31,7 @@ export async function saveGcpTriggerFromCfg(
|
||||
enabled: cfg.enabled,
|
||||
is_flow: cfg.is_flow,
|
||||
auto_acknowledge_msg: cfg.auto_acknowledge_msg,
|
||||
ack_deadline: cfg.ack_deadline,
|
||||
...errorHandlerAndRetries
|
||||
}
|
||||
if (edit) {
|
||||
|
||||
Reference in New Issue
Block a user