diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2020-10-28 06:21:09 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2020-10-28 06:21:09 +0300 |
commit | 1177c38011786e08c9685ac61a379364c6a930ed (patch) | |
tree | 81a8c475846bb7d31d86f1ca3bc6809fb83c996a /internal/vfs | |
parent | 0db58b5ce378aad7106ea1c0d04fa50e3b5ad54e (diff) |
Rename openTiemoutmake-cache-configurable
Diffstat (limited to 'internal/vfs')
-rw-r--r-- | internal/vfs/zip/vfs.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/vfs/zip/vfs.go b/internal/vfs/zip/vfs.go index 0685c5d9..fe152260 100644 --- a/internal/vfs/zip/vfs.go +++ b/internal/vfs/zip/vfs.go @@ -40,7 +40,7 @@ type zipVFS struct { cache *cache.Cache cacheLock sync.Mutex - defaultOpenTimeout time.Duration + openTimeout time.Duration cacheExpirationInterval time.Duration cacheRefreshInterval time.Duration cacheCleanupInterval time.Duration @@ -75,10 +75,10 @@ func WithCacheCleanupInterval(interval time.Duration) Option { } } -// WithDefaultOpenTimeout when used it can override defaultOpenTimeout -func WithDefaultOpenTimeout(interval time.Duration) Option { +// WithOpenTimeout when used it can override openTimeout +func WithOpenTimeout(interval time.Duration) Option { return func(vfs *zipVFS) { - vfs.defaultOpenTimeout = interval + vfs.openTimeout = interval } } @@ -88,7 +88,7 @@ func New(options ...Option) vfs.VFS { cacheExpirationInterval: defaultCacheExpirationInterval, cacheRefreshInterval: defaultCacheRefreshInterval, cacheCleanupInterval: defaultCacheCleanupInterval, - defaultOpenTimeout: defaultOpenTimeout, + openTimeout: defaultOpenTimeout, } for _, option := range options { @@ -158,7 +158,7 @@ func (fs *zipVFS) findOrCreateArchive(ctx context.Context, path string) (*zipArc fs.cache.SetDefault(path, archive) } } else { - archive = newArchive(fs, path, fs.defaultOpenTimeout) + archive = newArchive(fs, path, fs.openTimeout) // We call delete to ensure that expired item // is properly evicted as there's a bug in a cache library: |