Skip to content

Commit

Permalink
Gdrive Connector: log tags when failing to upsert document
Browse files Browse the repository at this point in the history
  • Loading branch information
PopDaph committed Nov 22, 2023
1 parent edac56f commit 10a3292
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions connectors/src/connectors/google_drive/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,18 +482,23 @@ async function syncOneFile(
parents.push(file.id);
parents.reverse();

await upsertToDatasource({
dataSourceConfig,
documentId,
documentText: documentContent,
documentUrl: file.webViewLink,
timestampMs: file.updatedAtMs,
tags,
parents: parents,
upsertContext: {
sync_type: isBatchSync ? "batch" : "incremental",
},
});
try {
await upsertToDatasource({
dataSourceConfig,
documentId,
documentText: documentContent,
documentUrl: file.webViewLink,
timestampMs: file.updatedAtMs,
tags,
parents: parents,
upsertContext: {
sync_type: isBatchSync ? "batch" : "incremental",
},
});
} catch (e) {
logger.error({ error: e, tags }, "Failed to upsert document");
throw e;
}
upsertTimestampMs = file.updatedAtMs;
} else {
logger.info(
Expand Down

0 comments on commit 10a3292

Please sign in to comment.