Skip to content

Commit

Permalink
Allow blacklisting GDrive file ids. (#3195)
Browse files Browse the repository at this point in the history
* Allow blacklisting GDrive file ids.

* ✂️

* 🔁
  • Loading branch information
flvndvd authored Jan 13, 2024
1 parent e814004 commit b09bc37
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions connectors/src/connectors/google_drive/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ import logger from "@connectors/logger/logger";
const FILES_SYNC_CONCURRENCY = 10;
const FILES_GC_CONCURRENCY = 5;

const GDRIVE_FILE_IDS_BLACKLIST = [
"1IR3Ql2-QfGf9VUIqTqAunzYJi0pQNg3u",
"1Seekzy_3m_P0blWP37mU2roMc5HYtULH",
"1aUUY4nDPrM8YCxFybW_ClVud4TnqQC1w",
"10Yaj4T-_UOzSaE7Ea0qEZLULU1noZWSX",
];

export const MIME_TYPES_TO_EXPORT: { [key: string]: string } = {
"application/vnd.google-apps.document": "text/plain",
"application/vnd.google-apps.presentation": "text/plain",
Expand Down Expand Up @@ -509,6 +516,17 @@ async function syncOneFile(
return false;
}

if (GDRIVE_FILE_IDS_BLACKLIST.includes(file.id)) {
logger.info(
{
file_id: file.id,
title: file.name,
},
`File ID is blacklisted. Skipping`
);
return false;
}

if (!documentContent || documentContent.trim().length === 0) {
logger.info(
{
Expand All @@ -520,6 +538,8 @@ async function syncOneFile(
},
"Skipping empty document"
);

return false;
}

const content = renderDocumentTitleAndContent({
Expand Down

0 comments on commit b09bc37

Please sign in to comment.