Skip to content

Commit

Permalink
enh(doc tracker): improve logs (#8187)
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Fontanier <[email protected]>
  • Loading branch information
fontanierh and Henry Fontanier authored Oct 23, 2024
1 parent 8ffe70c commit c126016
Showing 1 changed file with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,21 @@ export async function shouldDocumentTrackerSuggestChangesRun(
} = params;
const isBatchSync = upsertContext?.sync_type === "batch";

if (isBatchSync) {
logger.info(
"document_tracker_suggest_changes post process hook should not run for batch sync."
);
return false;
}

const owner = auth.workspace();
if (!owner) {
throw new Error("Workspace not found.");
}

const owner = auth.getNonNullableWorkspace();
const localLogger = logger.child({
workspaceId: owner.sId,
dataSourceId,
documentId,
dataSourceConnectorProvider,
});

if (isBatchSync) {
localLogger.info(
"document_tracker_suggest_changes post process hook should not run for batch sync."
);
return false;
}

if (!owner.flags.includes("document_tracker")) {
return false;
}
Expand Down

0 comments on commit c126016

Please sign in to comment.