fix(wire): resolveDataDir 改用 cfg.DataDir(.env 的 DATA_DIR 真正生效,不再落平台默认目录)
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

This commit is contained in:
Aska committed 2026-09-06 10:32:20 +08:00
1 parent 3632e04733
commit cee2d26205
1 file changed
+4 -3
+4 -3
View File
@@ -480,10 +480,11 @@ func (a *app) close(ctx context.Context) {
a.log.Info("cyrene shutdown complete")
}
// resolveDataDir returns the configured data directory, or the OS-appropriate
// default when DATA_DIR is not exported to the process environment.
// resolveDataDir returns the configured data directory (from .env / env, via
// cfg.DataDir), falling back to the OS-appropriate default only when no
// directory is configured.
func resolveDataDir(cfg *config.Config) string {
if _, ok := os.LookupEnv("DATA_DIR"); ok {
if cfg.DataDir != "" {
return cfg.DataDir
}
return platform.DefaultDataDir()