-
Notifications
You must be signed in to change notification settings - Fork 113
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
cache displaynames in ocs #1161
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
@ishank011 @labkode this kind of caching should at least happen per request. other services could use it as well, eg. the strage provider if it needs to look up the username of a user when it only has the id. should we have a reusable type of cache or just get sth like this in asap. |
714041e
to
d8d0865
Compare
I propose to get this in as is. It makes listing shares usable. We can improve further if needed. @ishank011 @labkode review and merge? |
https://cloud.drone.io/cs3org/reva/2609/6/7
|
d8d0865
to
d2cafa2
Compare
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
d2cafa2
to
9b2a5d1
Compare
rebased ... the feature lines seemed to be off ... 🤞 |
9b2a5d1
to
07085e3
Compare
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
07085e3
to
fffbe6b
Compare
@labkode fixed tests, merge if you please. |
The ocs list shares endpoint may need to fetch the displayname for multiple different users. We are now caching the lookup fo 60 seconds to save redundant RPCs to the users service.
get a better cache implementation?moving to a pkg because caching a username for 60sec is good enough for now.use a displayname cache or better a full blown user struct cache that could bu used in other handlers as well?for now, the sharing code really only needs to look up displaynamesimplement a recent users (and groups) cache whenever we get a new userid in the access token so we always have the most recent users cached?left for a subsequent PR. It would need to make the cache part of the handler that is used in all ocs handlers.