Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf160830

Browse files
authored
fix: Update default cache directory (#4175)
Fixes#2534.
1 parent38e2a28 commitf160830

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎cli/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,11 +785,16 @@ func Server(newAPI func(context.Context, *coderd.Options) (*coderd.API, error))
785785
"Serve pprof metrics on the address defined by `pprof-address`.")
786786
cliflag.StringVarP(root.Flags(),&pprofAddress,"pprof-address","","CODER_PPROF_ADDRESS","127.0.0.1:6060",
787787
"The bind address to serve pprof.")
788-
defaultCacheDir:=filepath.Join(os.TempDir(),"coder-cache")
788+
789+
defaultCacheDir,err:=os.UserCacheDir()
790+
iferr!=nil {
791+
defaultCacheDir=os.TempDir()
792+
}
789793
ifdir:=os.Getenv("CACHE_DIRECTORY");dir!="" {
790794
// For compatibility with systemd.
791795
defaultCacheDir=dir
792796
}
797+
defaultCacheDir=filepath.Join(defaultCacheDir,"coder")
793798
cliflag.StringVarP(root.Flags(),&cacheDir,"cache-dir","","CODER_CACHE_DIRECTORY",defaultCacheDir,
794799
"The directory to cache temporary files. If unspecified and $CACHE_DIRECTORY is set, it will be used for compatibility with systemd.")
795800
cliflag.BoolVarP(root.Flags(),&inMemoryDatabase,"in-memory","","CODER_INMEMORY",false,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp