Skip to content

Commit

Permalink
skip pages that have a skip reason in the db
Browse files Browse the repository at this point in the history
  • Loading branch information
aubin-tchoi committed Dec 13, 2024
1 parent 5272d30 commit 3e9b565
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions connectors/src/connectors/confluence/lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
upsertConfluencePageToDataSource,
} from "@connectors/connectors/confluence/temporal/activities";
import { dataSourceConfigFromConnector } from "@connectors/lib/api/data_source_config";
import { ConfluencePage } from "@connectors/lib/models/confluence";
import { default as topLogger } from "@connectors/logger/logger";
import { ConnectorResource } from "@connectors/resources/connector_resource";

Expand Down Expand Up @@ -47,6 +48,15 @@ export const confluence = async ({
};
const localLogger = logger.child(loggerArgs);

const pageInDb = await ConfluencePage.findOne({
attributes: ["parentId", "skipReason", "version"],
where: { connectorId, pageId },
});
if (pageInDb && pageInDb.skipReason !== null) {
localLogger.info("Confluence page skipped.");
return { success: false };
}

const client = await getConfluenceClient(
{ cloudId: confluenceConfig?.cloudId },
connector
Expand Down

0 comments on commit 3e9b565

Please sign in to comment.