mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-08 14:10:30 +02:00
Fix bug with Google Drive shortcut error case
This commit is contained in:
parent
d6a84ab413
commit
eeb844e35e
@ -101,12 +101,18 @@ def _run_drive_file_query(
|
|||||||
for file in files:
|
for file in files:
|
||||||
if follow_shortcuts and "shortcutDetails" in file:
|
if follow_shortcuts and "shortcutDetails" in file:
|
||||||
try:
|
try:
|
||||||
file = service.files().get(
|
file_shortcut_points_to = add_retries(
|
||||||
|
lambda: (
|
||||||
|
service.files()
|
||||||
|
.get(
|
||||||
fileId=file["shortcutDetails"]["targetId"],
|
fileId=file["shortcutDetails"]["targetId"],
|
||||||
supportsAllDrives=include_shared,
|
supportsAllDrives=include_shared,
|
||||||
fields="mimeType, id, name, modifiedTime, webViewLink, shortcutDetails",
|
fields="mimeType, id, name, modifiedTime, webViewLink, shortcutDetails",
|
||||||
)
|
)
|
||||||
file = add_retries(lambda: file.execute())()
|
.execute()
|
||||||
|
)
|
||||||
|
)()
|
||||||
|
yield file_shortcut_points_to
|
||||||
except HttpError:
|
except HttpError:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"Failed to follow shortcut with details: {file['shortcutDetails']}"
|
f"Failed to follow shortcut with details: {file['shortcutDetails']}"
|
||||||
@ -114,6 +120,7 @@ def _run_drive_file_query(
|
|||||||
if continue_on_failure:
|
if continue_on_failure:
|
||||||
continue
|
continue
|
||||||
raise
|
raise
|
||||||
|
else:
|
||||||
yield file
|
yield file
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user