Skip to content

Commit

Permalink
Only retry for expired keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ishank011 committed Nov 11, 2021
1 parent 51512eb commit d76f383
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/storage/utils/eosfs/eosfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ func NewEOSFS(c *Config) (storage.FS, error) {
eosfs.userIDCache.SetExpirationReasonCallback(func(key string, reason ttlcache.EvictionReason, value interface{}) {
// We only set those keys with TTL which we weren't able to retrieve the last time
// For those keys, try to contact the userprovider service again when they expire
_, _ = eosfs.getUserIDGateway(context.Background(), key)
if reason == ttlcache.Expired {
_, _ = eosfs.getUserIDGateway(context.Background(), key)
}
})

go eosfs.userIDcacheWarmup()
Expand Down Expand Up @@ -1759,6 +1761,7 @@ func (fs *eosfs) convert(ctx context.Context, eosFileInfo *eosclient.FileInfo) (
Size: size,
PermissionSet: fs.permissionSet(ctx, eosFileInfo, owner),
Checksum: &xs,
Type: getResourceType(eosFileInfo.IsDir),
Mtime: &types.Timestamp{
Seconds: eosFileInfo.MTimeSec,
Nanos: eosFileInfo.MTimeNanos,
Expand All @@ -1783,7 +1786,6 @@ func (fs *eosfs) convert(ctx context.Context, eosFileInfo *eosclient.FileInfo) (
}
}

info.Type = getResourceType(eosFileInfo.IsDir)
return info, nil
}

Expand Down

0 comments on commit d76f383

Please sign in to comment.