aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/storage.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2019-04-23 00:49:04 +0200
committerGitHub <noreply@github.com>2019-04-23 00:49:04 +0200
commiteb243ba9a55ac029ab3f9b15157920c46e24078b (patch)
tree7f3de8cec7a252cc7d00c721b230c4179513b9ca /storage/filesystem/storage.go
parent7b3220f1790e35ed1596540363599099c2821b9f (diff)
parentf5c23dae1fc7508b2d5cbac5a2954203ea4c3ac2 (diff)
downloadgo-git-eb243ba9a55ac029ab3f9b15157920c46e24078b.tar.gz
Merge pull request #1123 from saracen/object-storage-open-packfile
filesystem: ObjectStorage, MaxOpenDescriptors option
Diffstat (limited to 'storage/filesystem/storage.go')
-rw-r--r--storage/filesystem/storage.go4
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)