Skip to content

Commit e1498b7

Browse files
committed
Limit pagination in fetchSharePointSitesByAppToken to 50 pages
1 parent f8cecc1 commit e1498b7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/server/src/sdk/workspace/ai/knowledgeSources/sharepointConnection

packages/server/src/sdk/workspace/ai/knowledgeSources/sharepointConnection/connection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ const fetchSharePointSitesByAppToken = async (
311311
const sitesById = new Map<string, KnowledgeSourceOption>()
312312
let nextLink = `${SHAREPOINT_API_BASE}/sites?search=*&$top=200&$select=id,displayName,name,webUrl`
313313

314-
while (nextLink) {
314+
for (let page = 0; nextLink && page < 50; page++) {
315315
const response = await fetch(nextLink, {
316316
headers: {
317317
Authorization: bearerToken,

0 commit comments

Comments
 (0)