mirror of
https://github.com/papra-hq/papra.git
synced 2025-12-30 16:24:55 -06:00
fix(ingestion-folders): ensure doneFolders and errorFolders are string arrays for proper exclusion pattern (#483)
This commit is contained in:
committed by
GitHub
parent
1606310745
commit
ec0a437d86
5
.changeset/cold-walls-drop.md
Normal file
5
.changeset/cold-walls-drop.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@papra/app-server": patch
|
||||
---
|
||||
|
||||
Fix a bug where the ingestion folder was not working when the done or error destination folder path (INGESTION_FOLDER_POST_PROCESSING_MOVE_FOLDER_PATH and INGESTION_FOLDER_ERROR_FOLDER_PATH) were absolute.
|
||||
@@ -235,10 +235,10 @@ async function buildPathIgnoreFunction({
|
||||
const { organizationIds } = await organizationsRepository.getAllOrganizationIds();
|
||||
|
||||
const doneFolders = strategy === 'move'
|
||||
? isAbsolute(moveToFolderPath) ? moveToFolderPath : uniq(organizationIds.map(id => join(cwd, folderRootPath, id, moveToFolderPath)))
|
||||
? isAbsolute(moveToFolderPath) ? [moveToFolderPath] : uniq(organizationIds.map(id => join(cwd, folderRootPath, id, moveToFolderPath)))
|
||||
: [];
|
||||
|
||||
const errorFolders = isAbsolute(errorFolder) ? errorFolder : uniq(organizationIds.map(id => join(cwd, folderRootPath, id, errorFolder)));
|
||||
const errorFolders = isAbsolute(errorFolder) ? [errorFolder] : uniq(organizationIds.map(id => join(cwd, folderRootPath, id, errorFolder)));
|
||||
|
||||
const ignoredFolders = [...doneFolders, ...errorFolders];
|
||||
const matchExcludedPatterns = picomatch(ignoredPatterns);
|
||||
|
||||
Reference in New Issue
Block a user