diff options
author | Arran Walker <arran.walker@fiveturns.org> | 2019-04-21 00:37:59 +0000 |
---|---|---|
committer | Arran Walker <arran.walker@fiveturns.org> | 2019-04-22 22:44:21 +0000 |
commit | f5c23dae1fc7508b2d5cbac5a2954203ea4c3ac2 (patch) | |
tree | cd0a254f9041344b0cb2d640d5f4b9ed01729cfd /storage/filesystem/storage.go | |
parent | e5268e9c3c94f60e3c2008dc2ab4762c75352bfc (diff) | |
download | go-git-f5c23dae1fc7508b2d5cbac5a2954203ea4c3ac2.tar.gz |
filesystem: ObjectStorage, MaxOpenDescriptors option
The MaxOpenDescriptors option provides a middle ground solution between keeping
all packfiles open (as offered by the KeepDescriptors option) and keeping none
open.
Signed-off-by: Arran Walker <arran.walker@fiveturns.org>
Diffstat (limited to 'storage/filesystem/storage.go')
-rw-r--r-- | storage/filesystem/storage.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/storage/filesystem/storage.go b/storage/filesystem/storage.go index 370f7bd..88d1ed4 100644 --- a/storage/filesystem/storage.go +++ b/storage/filesystem/storage.go @@ -31,6 +31,9 @@ type Options struct { // KeepDescriptors makes the file descriptors to be reused but they will // need to be manually closed calling Close(). KeepDescriptors bool + // MaxOpenDescriptors is the max number of file descriptors to keep + // open. If KeepDescriptors is true, all file descriptors will remain open. + MaxOpenDescriptors int } // NewStorage returns a new Storage backed by a given `fs.Filesystem` and cache. @@ -43,7 +46,6 @@ func NewStorage(fs billy.Filesystem, cache cache.Object) *Storage { func NewStorageWithOptions(fs billy.Filesystem, cache cache.Object, ops Options) *Storage { dirOps := dotgit.Options{ ExclusiveAccess: ops.ExclusiveAccess, - KeepDescriptors: ops.KeepDescriptors, } dir := dotgit.NewWithOptions(fs, dirOps) |