mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
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:
@@ -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', () => ({
|
||||
|
||||
Reference in New Issue
Block a user