fix(server): resolve APP_DATA_PATH to an absolute path at startup

When APP_DATA_PATH is set to a relative path (e.g. ../local/data), the
stored absolutePath in book_dock_files was relative. The file watcher
(@parcel/watcher) always reports events with fully resolved absolute
paths, so findByAbsolutePath never matched an uploaded file, causing the
watcher to ingest it again as a duplicate record.
This commit is contained in:
neon
2026-05-11 03:26:12 +00:00
parent 4a53a9250e
commit 8e8b8ae303
+2 -1
View File
@@ -1,4 +1,5 @@
import { registerAs } from '@nestjs/config';
import { resolve } from 'path';
export const appConfig = registerAs('app', () => ({
nodeEnv: process.env.NODE_ENV ?? 'development',
@@ -17,7 +18,7 @@ export const authConfig = registerAs('auth', () => ({
}));
export const storageConfig = registerAs('storage', () => ({
appDataPath: process.env.APP_DATA_PATH ?? '/data',
appDataPath: resolve(process.env.APP_DATA_PATH ?? '/data'),
}));
export const fileWriteConfig = registerAs('fileWrite', () => ({