forked from TrueCloudLab/frostfs-s3-gw
[#179] api: Add cache for ListObjectsV1/V2
Refactored cache for ListObjects: made cache common for all versions, simplified: remove dependendence on token/startafter add mitable cachelifetime. Refactored listobjects Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
parent
a0fb14d91e
commit
8a69c7cca0
3 changed files with 136 additions and 113 deletions
|
@ -24,7 +24,7 @@ type (
|
|||
layer struct {
|
||||
pool pool.Pool
|
||||
log *zap.Logger
|
||||
cache ObjectsListV2Cache
|
||||
cache ObjectsListCache
|
||||
}
|
||||
|
||||
// Params stores basic API parameters.
|
||||
|
@ -131,7 +131,7 @@ func NewLayer(log *zap.Logger, conns pool.Pool) Client {
|
|||
return &layer{
|
||||
pool: conns,
|
||||
log: log,
|
||||
cache: newListObjectsCache(),
|
||||
cache: newListObjectsCache(defaultCacheLifetime),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue