Skip to content

Commit

Permalink
fix: Avoid indexing large files
Browse files Browse the repository at this point in the history
  • Loading branch information
baumandm committed Aug 29, 2024
1 parent 0ec611f commit cff63fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/backend/src/lib/backends/github.sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,9 @@ const syncFiles = async (
};

// Include the contents of text-based files
if (INDEXABLE_MIME_TYPES.has(file.mimeType) || file.mimeType.startsWith('text/')) {
if (INDEXABLE_MIME_TYPES.has(file.mimeType) || file.mimeType.startsWith('text/')

Check failure on line 485 in packages/backend/src/lib/backends/github.sync.ts

View workflow job for this annotation

GitHub Actions / verify

Replace `INDEXABLE_MIME_TYPES.has(file.mimeType)·||·file.mimeType.startsWith('text/')` with `⏎········INDEXABLE_MIME_TYPES.has(file.mimeType)·||⏎········(file.mimeType.startsWith('text/')·&&`
// Ensure the file is less than 1MB

Check failure on line 486 in packages/backend/src/lib/backends/github.sync.ts

View workflow job for this annotation

GitHub Actions / verify

Insert `··`
&& file.size < 1024 * 1024) {

Check failure on line 487 in packages/backend/src/lib/backends/github.sync.ts

View workflow job for this annotation

GitHub Actions / verify

Replace `&&·file.size·<·1024·*·1024` with `··file.size·<·1024·*·1024)⏎······`
file.contents = contents?.toString('utf8');
}

Expand Down

0 comments on commit cff63fb

Please sign in to comment.