Skip to content

Commit

Permalink
fix: only log if relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanierh committed Oct 18, 2023
1 parent b9688bd commit fb5ff7b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions connectors/src/connectors/notion/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ export async function renderAndUpsertPageFromCache({
parentType,
pageId,
accessToken,
loggerArgs = {
loggerArgs: {
...loggerArgs,
workspaceId: connector.workspaceId,
dataSourceName: connector.dataSourceName,
Expand Down Expand Up @@ -1913,13 +1913,15 @@ export async function getDiscoveredResourcesFromCache(
(id) => !databaseIdsAlreadySeen.has(id)
);

localLogger.info(
{
discoveredPageIdsCount: discoveredPageIds.length,
discoveredDatabaseIdsCount: discoveredDatabaseIds.length,
},
"Discovered new resources."
);
if (discoveredPageIds.length || discoveredDatabaseIds.length) {
localLogger.info(
{
discoveredPageIdsCount: discoveredPageIds.length,
discoveredDatabaseIdsCount: discoveredDatabaseIds.length,
},
"Discovered new resources."
);
}

return {
pageIds: discoveredPageIds,
Expand Down

0 comments on commit fb5ff7b

Please sign in to comment.