Skip to content

Commit

Permalink
Make use of Temporal/executeChild type safe (#1178)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasryaric authored Aug 31, 2023
1 parent 27d2325 commit 43c53e5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions connectors/src/connectors/github/temporal/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export async function githubFullSyncWorkflow(
const childWorkflowId = `${fullSyncWorkflowId}-repo-${repo.id}`;
promises.push(
queue.add(() =>
executeChild(githubRepoSyncWorkflow.name, {
executeChild(githubRepoSyncWorkflow, {
workflowId: childWorkflowId,
args: [
dataSourceConfig,
Expand Down Expand Up @@ -110,7 +110,7 @@ export async function githubReposSyncWorkflow(
const childWorkflowId = `${reposSyncWorkflowId}-repo-${repo.id}`;
promises.push(
queue.add(() =>
executeChild(githubRepoSyncWorkflow.name, {
executeChild(githubRepoSyncWorkflow, {
workflowId: childWorkflowId,
args: [
dataSourceConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export async function googleDriveFullSync(
await syncSucceeded(connectorId);

if (garbageCollect) {
await executeChild(googleDriveGarbageCollectorWorkflow.name, {
await executeChild(googleDriveGarbageCollectorWorkflow, {
workflowId: googleDriveGarbageCollectorWorkflowId(connectorId),
args: [connectorId, startSyncTs],
});
Expand Down
4 changes: 2 additions & 2 deletions connectors/src/connectors/notion/temporal/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export async function notionSyncWorkflow(
}`;
promises.push(
childWorkflowQueue.add(() =>
executeChild(notionSyncResultPageWorkflow.name, {
executeChild(notionSyncResultPageWorkflow, {
workflowId,
args: [
dataSourceConfig,
Expand Down Expand Up @@ -193,7 +193,7 @@ export async function notionSyncWorkflow(
}`;
promises.push(
childWorkflowQueue.add(() =>
executeChild(notionSyncResultPageDatabaseWorkflow.name, {
executeChild(notionSyncResultPageDatabaseWorkflow, {
workflowId,
args: [
dataSourceConfig,
Expand Down
4 changes: 2 additions & 2 deletions connectors/src/connectors/slack/temporal/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export async function workspaceFullSync(
const channels = await getChannels(slackAccessToken);
let i = 0;
for (const channel of channels) {
if (!channel.id) {
if (!channel.id || !channel.name) {
throw new Error(`Channel ${channel.name} has no id`);
}
await executeChild(syncOneChannel.name, {
await executeChild(syncOneChannel, {
workflowId: syncOneChanneWorkflowlId(connectorId, channel.id),
args: [
connectorId,
Expand Down

0 comments on commit 43c53e5

Please sign in to comment.