diff --git a/packages/jobs/lib/execution/onEvent.ts b/packages/jobs/lib/execution/onEvent.ts index 02d626baf7..5bb5f81d94 100644 --- a/packages/jobs/lib/execution/onEvent.ts +++ b/packages/jobs/lib/execution/onEvent.ts @@ -110,7 +110,7 @@ export async function startOnEvent(task: TaskOnEvent): Promise> { } export async function handleOnEventSuccess({ nangoProps }: { nangoProps: NangoProps }): Promise { - const content = `Webhook "${nangoProps.syncConfig.sync_name}" has been run successfully.`; + const content = `Script "${nangoProps.syncConfig.sync_name}" has been run successfully.`; void bigQueryClient.insert({ executionType: 'on-event', connectionId: nangoProps.connectionId, diff --git a/packages/orchestrator/lib/clients/client.ts b/packages/orchestrator/lib/clients/client.ts index f8d691f026..544ff6e030 100644 --- a/packages/orchestrator/lib/clients/client.ts +++ b/packages/orchestrator/lib/clients/client.ts @@ -254,17 +254,28 @@ export class OrchestratorClient { return this.execute(schedulingProps); } - public async executeOnEvent(props: ExecuteOnEventProps): Promise { + public async executeOnEvent(props: ExecuteOnEventProps): Promise { const { args, ...rest } = props; const schedulingProps = { + retry: { count: 0, max: 0 }, + timeoutSettingsInSecs: { + createdToStarted: 30, + startedToCompleted: 5 * 60, + heartbeat: 99999 + }, ...rest, args: { ...args, type: 'on-event' as const } }; - return this.execute(schedulingProps); + const res = await this.immediate(schedulingProps); + if (res.isErr()) { + return Err(res.error); + } + return Ok(undefined); } + public async searchTasks({ ids, groupKey, diff --git a/packages/server/lib/hooks/connection/on/connection-created.ts b/packages/server/lib/hooks/connection/on/connection-created.ts index 2ddc193ba4..c2f16583c6 100644 --- a/packages/server/lib/hooks/connection/on/connection-created.ts +++ b/packages/server/lib/hooks/connection/on/connection-created.ts @@ -50,8 +50,6 @@ export async function postConnectionCreation( }); if (res.isErr()) { await logCtx.failed(); - } else { - await logCtx.success(); } } } diff --git a/packages/server/lib/hooks/connection/on/connection-deleted.ts b/packages/server/lib/hooks/connection/on/connection-deleted.ts index 74e24ae604..5f4a08c24a 100644 --- a/packages/server/lib/hooks/connection/on/connection-deleted.ts +++ b/packages/server/lib/hooks/connection/on/connection-deleted.ts @@ -52,8 +52,6 @@ export async function preConnectionDeletion({ }); if (res.isErr()) { await logCtx.failed(); - } else { - await logCtx.success(); } } } diff --git a/packages/shared/lib/clients/orchestrator.ts b/packages/shared/lib/clients/orchestrator.ts index 5b6ba3247a..b3633a9e83 100644 --- a/packages/shared/lib/clients/orchestrator.ts +++ b/packages/shared/lib/clients/orchestrator.ts @@ -52,7 +52,7 @@ export interface OrchestratorClientInterface { recurring(props: RecurringProps): Promise>; executeAction(props: ExecuteActionProps): Promise; executeWebhook(props: ExecuteWebhookProps): Promise; - executeOnEvent(props: ExecuteOnEventProps): Promise; + executeOnEvent(props: ExecuteOnEventProps): Promise; executeSync(props: ExecuteSyncProps): Promise; pauseSync({ scheduleName }: { scheduleName: string }): Promise; unpauseSync({ scheduleName }: { scheduleName: string }): Promise;