fix(wire): resolveDataDir 改用 cfg.DataDir(.env 的 DATA_DIR 真正生效,不再落平台默认目录)
This commit is contained in:
1 parent
3632e04733
commit
cee2d26205
1 file changed
+4
-3
+4
-3
@@ -480,10 +480,11 @@ func (a *app) close(ctx context.Context) {
|
|||||||
a.log.Info("cyrene shutdown complete")
|
a.log.Info("cyrene shutdown complete")
|
||||||
}
|
}
|
||||||
|
|
||||||
// resolveDataDir returns the configured data directory, or the OS-appropriate
|
// resolveDataDir returns the configured data directory (from .env / env, via
|
||||||
// default when DATA_DIR is not exported to the process environment.
|
// cfg.DataDir), falling back to the OS-appropriate default only when no
|
||||||
|
// directory is configured.
|
||||||
func resolveDataDir(cfg *config.Config) string {
|
func resolveDataDir(cfg *config.Config) string {
|
||||||
if _, ok := os.LookupEnv("DATA_DIR"); ok {
|
if cfg.DataDir != "" {
|
||||||
return cfg.DataDir
|
return cfg.DataDir
|
||||||
}
|
}
|
||||||
return platform.DefaultDataDir()
|
return platform.DefaultDataDir()
|
||||||
|
|||||||
Reference in new issue
Block a user