-
Notifications
You must be signed in to change notification settings - Fork 227
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
Add global lru for routes with keys being the appname + path #472
Conversation
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.
This shall be OK for single-node deployments. On a multi-node deployment, we need somehow to be able to invalidate local node's cache whenever the DB gets updated by some other entity/node.
@@ -5,4 +5,8 @@ Copyright 2013 Julien Schmidt. All rights reserved. BSD-license | |||
|
|||
For: api/server/internal/routecache/lru.go | |||
For: api/server/singleflight.go | |||
Copyright 2012 Google Inc. All rights reserved. Apache 2 license |
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 the duplication here?
return | ||
} | ||
|
||
// Delete ... |
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.
function description is missing.
@@ -99,5 +99,8 @@ func (s *Server) handleRouteCreate(c *gin.Context) { | |||
return | |||
} | |||
|
|||
// For any create just push the new route to the front of the list |
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.
Is this comment really necessary? it seems quite self-evident for me that Refresh
will push the new route to the front of the list.
For: api/server/singleflight.go |
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.
Still duplicated...
Use a global LRU for routes matching during function calls