-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pull: add cache for gcr bug #1024
Conversation
Signed-off-by: Tonis Tiigi <[email protected]>
ref = r.repo(ref) + "-" + session.FromContext(ctx) | ||
|
||
cr, ok := r.m[ref] | ||
cr.timeout = time.Now().Add(time.Minute) |
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.
Why 1 minute?
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.
Same as in moby. This should be enough to avoid the second request in most cases. Ideally, this could be connected to the /session
dropping.
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.
@tiborvass @thaJeztah @dmcgowan PTAL?
var cache *resolverCache | ||
|
||
func init() { | ||
cache = newResolverCache() |
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.
nit, but no need for init(), can be var cache = newResolverCache()
Is this in the vendored code in Moby? If so we might want to backport to the 18.09 branch |
fix #720
Signed-off-by: Tonis Tiigi [email protected]