Skip to content

Commit

Permalink
syncProgress nits (#3156)
Browse files Browse the repository at this point in the history
* slack: progress nits

* shorter
  • Loading branch information
spolu authored Jan 11, 2024
1 parent 2337e1c commit 96ed9b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
9 changes: 3 additions & 6 deletions connectors/src/connectors/slack/temporal/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,19 @@ export async function workspaceFullSync(
for (const channelId of input.channelIds) {
promises.push(
childWorkflowQueue.add(async () => {
const percentSync = Math.round(
(i / Math.max(promises.length, input.channelIds.length)) * 100
);
await reportInitialSyncProgressActivity(
connectorId,
`${percentSync}%`
`${i - 1}/${input.channelIds.length} channels`
);
i++;
return executeChild(syncOneChannel, {
await executeChild(syncOneChannel, {
workflowId: syncOneChanneWorkflowlId(connectorId, channelId),
searchAttributes: {
connectorId: [connectorId],
},
args: [connectorId, channelId, false, fromTs],
memo: workflowInfo().memo,
});
i++;
})
);
}
Expand Down
5 changes: 1 addition & 4 deletions connectors/src/connectors/webcrawler/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ export async function crawlWebsiteByConnectorId(connectorId: ModelId) {
},
});

await reportInitialSyncProgress(
connector.id,
`Crawled ${pageCount} pages.`
);
await reportInitialSyncProgress(connector.id, `${pageCount} pages`);

pageCount++;
},
Expand Down

0 comments on commit 96ed9b7

Please sign in to comment.