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

Merged
merged 5 commits into from Jan 5, 2017

Conversation

Projects
None yet
3 participants
@seiflotfy
Contributor

seiflotfy commented Jan 3, 2017

Use a global LRU for routes matching during function calls

@ucirello

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.

THIRD_PARTY Outdated
@@ -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

This comment has been minimized.

@ucirello

ucirello Jan 3, 2017

Contributor

Why the duplication here?

return
}
// Delete ...

This comment has been minimized.

@ucirello

ucirello Jan 3, 2017

Contributor

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

This comment has been minimized.

@ucirello

ucirello Jan 3, 2017

Contributor

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.

@seiflotfy seiflotfy force-pushed the globallru branch from 9c1c3c5 to 8e714aa Jan 4, 2017

THIRD_PARTY Outdated
For: api/server/singleflight.go

This comment has been minimized.

@ucirello

ucirello Jan 5, 2017

Contributor

Still duplicated...

@ucirello ucirello merged commit 6f8e946 into master Jan 5, 2017

2 checks passed

ci/circleci Your tests passed on CircleCI!
Details
licence/cla Contributor License Agreement is signed.
Details

@ucirello ucirello deleted the globallru branch Jan 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment