MCPcopy
hub / github.com/FlowiseAI/Flowise / processJob

Method processJob

packages/server/src/queue/UpsertQueue.ts:53–89  ·  view source on GitHub ↗
(
        data: IExecuteFlowParams | IExecuteDocStoreUpsert | IExecuteProcessLoader | IExecuteVectorStoreInsert | IExecutePreviewLoader
    )

Source from the content-addressed store, hash-verified

51 }
52
53 async processJob(
54 data: IExecuteFlowParams | IExecuteDocStoreUpsert | IExecuteProcessLoader | IExecuteVectorStoreInsert | IExecutePreviewLoader
55 ) {
56 if (this.appDataSource) data.appDataSource = this.appDataSource
57 if (this.telemetry) data.telemetry = this.telemetry
58 if (this.cachePool) data.cachePool = this.cachePool
59 if (this.usageCacheManager) data.usageCacheManager = this.usageCacheManager
60 if (this.componentNodes) data.componentNodes = this.componentNodes
61
62 // document-store/loader/preview
63 if (Object.prototype.hasOwnProperty.call(data, 'isPreviewOnly')) {
64 logger.info('Previewing loader...')
65 return await previewChunks(data as IExecutePreviewLoader)
66 }
67
68 // document-store/loader/process/:loaderId
69 if (Object.prototype.hasOwnProperty.call(data, 'isProcessWithoutUpsert')) {
70 logger.info('Processing loader...')
71 return await processLoader(data as IExecuteProcessLoader)
72 }
73
74 // document-store/vectorstore/insert/:loaderId
75 if (Object.prototype.hasOwnProperty.call(data, 'isVectorStoreInsert')) {
76 logger.info('Inserting vector store...')
77 return await insertIntoVectorStore(data as IExecuteVectorStoreInsert)
78 }
79
80 // document-store/upsert/:storeId
81 if (Object.prototype.hasOwnProperty.call(data, 'storeId')) {
82 logger.info('Upserting to vector store via document loader...')
83 return await executeDocStoreUpsert(data as IExecuteDocStoreUpsert)
84 }
85
86 // upsert-vector/:chatflowid
87 logger.info('Upserting to vector store via chatflow...')
88 return await executeUpsert(data as IExecuteFlowParams)
89 }
90}

Callers 2

createWorkerFunction · 0.45

Calls 6

previewChunksFunction · 0.90
processLoaderFunction · 0.90
insertIntoVectorStoreFunction · 0.90
executeDocStoreUpsertFunction · 0.90
executeUpsertFunction · 0.90
callMethod · 0.45

Tested by

no test coverage detected