Skip to content

Commit

Permalink
Add: debug log for notion duplicate docs (#7079)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraggle authored Sep 3, 2024
1 parent 3a5bf61 commit f119b69
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions connectors/src/connectors/notion/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,17 @@ export async function garbageCollectorMarkAsSeen({
const redisCli = await redisClient();
const redisKey = redisGarbageCollectorKey(connector.id);
if (pageIds.length > 0) {
// Temp: debug logging for a customer issue
const duplicatePageId = "167582ad-8d56-4f2d-a90c-bdb1289e55b6";
if (pageIds.find((id) => id === duplicatePageId)) {
localLogger.info(
{
pageIds: pageIds,
},
`Marking page id ${duplicatePageId} as seen`
);
}

await redisCli.sAdd(`${redisKey}-pages`, pageIds);
}
if (databaseIds.length > 0) {
Expand Down Expand Up @@ -819,6 +830,21 @@ export async function garbageCollect({
connector.id
);

// Temp: debug logging for a customer issue
const duplicatePageId = "167582ad-8d56-4f2d-a90c-bdb1289e55b6";
if (
resourcesToCheck.find(
(r) => r.resourceType === "page" && r.resourceId === "duplicatePageId"
)
) {
logger.info(
{
resourcesToCheck: resourcesToCheck,
},
`${duplicatePageId} is in the resources to check`
);
}

const NOTION_UNHEALTHY_ERROR_CODES = [
"internal_server_error",
"notionhq_client_request_timeout",
Expand Down Expand Up @@ -1088,6 +1114,17 @@ async function findResourcesNotSeenInGarbageCollectionRun(
return { pageIdsSeenInRun, databaseIdsSeenInRun };
})();

// Temp: debug logging for a customer issue
const duplicatePageId = "167582ad-8d56-4f2d-a90c-bdb1289e55b6";
if (pageIdsSeenInRun.has(duplicatePageId)) {
logger.info(
{
pageIdsSeenInRun: pageIdsSeenInRun.entries(),
},
`${duplicatePageId} has been seen in this run`
);
}

const pageSize = 500;

const pagesNotSeenInGarbageCollectionRun: Array<{
Expand Down

0 comments on commit f119b69

Please sign in to comment.