mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
improvement(knowledge): add Trigger.dev tags for connector sync and document processing tasks
This commit is contained in:
@@ -150,11 +150,14 @@ export async function dispatchSync(
|
||||
const requestId = options?.requestId ?? crypto.randomUUID()
|
||||
|
||||
if (isTriggerAvailable()) {
|
||||
await knowledgeConnectorSync.trigger({
|
||||
connectorId,
|
||||
fullSync: options?.fullSync,
|
||||
requestId,
|
||||
})
|
||||
await knowledgeConnectorSync.trigger(
|
||||
{
|
||||
connectorId,
|
||||
fullSync: options?.fullSync,
|
||||
requestId,
|
||||
},
|
||||
{ tags: [`connector:${connectorId}`] }
|
||||
)
|
||||
logger.info(`Dispatched connector sync to Trigger.dev`, { connectorId, requestId })
|
||||
} else {
|
||||
executeSync(connectorId, { fullSync: options?.fullSync }).catch((error) => {
|
||||
|
||||
@@ -687,6 +687,7 @@ export async function processDocumentsWithTrigger(
|
||||
payload: doc,
|
||||
options: {
|
||||
idempotencyKey: `doc-process-${doc.documentId}-${requestId}`,
|
||||
tags: [`kb:${doc.knowledgeBaseId}`, `doc:${doc.documentId}`],
|
||||
},
|
||||
}))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user