mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 07:01:07 +03:00
Fix/variable not read in custom loader (#5558)
* removed the pgcrypto extension creation (Azure bug) * fixing bug with variables in document loader * lint fix * fixed preexisting bug * fix unwanted changes
This commit is contained in:
committed by
GitHub
parent
55b6913c03
commit
64e9a15453
@@ -561,7 +561,12 @@ const _saveFileToStorage = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const _splitIntoChunks = async (appDataSource: DataSource, componentNodes: IComponentNodes, data: IDocumentStoreLoaderForPreview) => {
|
const _splitIntoChunks = async (
|
||||||
|
appDataSource: DataSource,
|
||||||
|
componentNodes: IComponentNodes,
|
||||||
|
data: IDocumentStoreLoaderForPreview,
|
||||||
|
workspaceId?: string
|
||||||
|
) => {
|
||||||
try {
|
try {
|
||||||
let splitterInstance = null
|
let splitterInstance = null
|
||||||
if (data.splitterId && data.splitterConfig && Object.keys(data.splitterConfig).length > 0) {
|
if (data.splitterId && data.splitterConfig && Object.keys(data.splitterConfig).length > 0) {
|
||||||
@@ -588,7 +593,8 @@ const _splitIntoChunks = async (appDataSource: DataSource, componentNodes: IComp
|
|||||||
appDataSource,
|
appDataSource,
|
||||||
databaseEntities,
|
databaseEntities,
|
||||||
logger,
|
logger,
|
||||||
processRaw: true
|
processRaw: true,
|
||||||
|
workspaceId
|
||||||
}
|
}
|
||||||
const docNodeInstance = new nodeModule.nodeClass()
|
const docNodeInstance = new nodeModule.nodeClass()
|
||||||
let docs: IDocument[] = await docNodeInstance.init(nodeData, '', options)
|
let docs: IDocument[] = await docNodeInstance.init(nodeData, '', options)
|
||||||
@@ -700,7 +706,7 @@ const previewChunksMiddleware = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const previewChunks = async ({ appDataSource, componentNodes, data, orgId }: IExecutePreviewLoader) => {
|
export const previewChunks = async ({ appDataSource, componentNodes, data, orgId, workspaceId }: IExecutePreviewLoader) => {
|
||||||
try {
|
try {
|
||||||
if (data.preview) {
|
if (data.preview) {
|
||||||
if (
|
if (
|
||||||
@@ -714,7 +720,7 @@ export const previewChunks = async ({ appDataSource, componentNodes, data, orgId
|
|||||||
if (!data.rehydrated) {
|
if (!data.rehydrated) {
|
||||||
await _normalizeFilePaths(appDataSource, data, null, orgId)
|
await _normalizeFilePaths(appDataSource, data, null, orgId)
|
||||||
}
|
}
|
||||||
let docs = await _splitIntoChunks(appDataSource, componentNodes, data)
|
let docs = await _splitIntoChunks(appDataSource, componentNodes, data, workspaceId)
|
||||||
const totalChunks = docs.length
|
const totalChunks = docs.length
|
||||||
// if -1, return all chunks
|
// if -1, return all chunks
|
||||||
if (data.previewChunkCount === -1) data.previewChunkCount = totalChunks
|
if (data.previewChunkCount === -1) data.previewChunkCount = totalChunks
|
||||||
|
|||||||
Reference in New Issue
Block a user