Skip to content

Commit 54c3ba0

Browse files
author
kuba--
committed
cache in MB
Signed-off-by: kuba-- <[email protected]>
1 parent 3d4dbb6 commit 54c3ba0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/gitbase/command/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ type Server struct {
4949
Password string `short:"P" long:"password" default:"" description:"Password used for connection."`
5050
PilosaURL string `long:"pilosa" default:"http://localhost:10101" description:"URL to your pilosa server." env:"PILOSA_ENDPOINT"`
5151
IndexDir string `short:"i" long:"index" default:"/var/lib/gitbase/index" description:"Directory where the gitbase indexes information will be persisted." env:"GITBASE_INDEX_DIR"`
52-
CacheSize cache.FileSize `long:"cache" default:"536870912" description:"Object cache size" env:"GITBASE_CACHE_SIZE"`
52+
CacheSize cache.FileSize `long:"cache" default:"512" description:"Object cache size in megabytes" env:"GITBASE_CACHESIZE_MB"`
5353
DisableSquash bool `long:"no-squash" description:"Disables the table squashing."`
5454
TraceEnabled bool `long:"trace" env:"GITBASE_TRACE" description:"Enables jaeger tracing"`
5555
ReadOnly bool `short:"r" long:"readonly" description:"Only allow read queries. This disables creating and deleting indexes as well." env:"GITBASE_READONLY"`
@@ -161,7 +161,7 @@ func (c *Server) buildDatabase() error {
161161
c.engine = NewDatabaseEngine(c.ReadOnly, c.Version)
162162
}
163163

164-
c.pool = gitbase.NewRepositoryPool(c.CacheSize)
164+
c.pool = gitbase.NewRepositoryPool(c.CacheSize * cache.MiByte)
165165

166166
if err := c.addDirectories(); err != nil {
167167
return err

0 commit comments

Comments
 (0)