From 1177c38011786e08c9685ac61a379364c6a930ed Mon Sep 17 00:00:00 2001 From: Jaime Martinez Date: Wed, 28 Oct 2020 14:21:09 +1100 Subject: Rename openTiemout --- internal/vfs/zip/vfs.go | 12 ++++++------ 1 file 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: -- cgit v1.2.3