-
Notifications
You must be signed in to change notification settings - Fork 540
Conversation
storage/filesystem/object.go
Outdated
|
||
return s, nil | ||
func (s *ObjectStorage) WithCache(cache cache.Object) *ObjectStorage { | ||
s.deltaBaseCache = cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache should be passed to the constructor in the same way we do with the dotgit instance since is required, the options are optional, but if in the case of the cache the LRU is being instanced always in the constructor wasting resources.
func NewObjectStorage(dir *dotgit.DotGit, cache cache.Object) *ObjectStorage {
@mcuadros - now cache is required param in constructors. |
storage/filesystem/object.go
Outdated
if oe != nil { | ||
continue | ||
} | ||
o := NewObjectStorage(dg, cache.NewObjectLRUDefault()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use here s.deltaBaseCache
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, good question - I think so.
Done (@ajnavarro )
Signed-off-by: kuba-- <[email protected]>
Oy gevalt! A backward incompatible change passed off in a minor release. Thanks! |
@maguro This is how you learn to use vendoring and |
Not sure why the dismissive tone, this is indeed a breaking change, and it should not have been merged. I've raised #1262. I think the signature change should be reverted. |
Signed-off-by: kuba-- [email protected]
If we want to let apps. adjust cache size (or pass own implementation) we need to expose it somehow.
It's related to src-d/gitbase#440
Also we don't need to return an error from constructors like
NewStorage
.