-
Notifications
You must be signed in to change notification settings - Fork 121
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
Modify cache purging limit #70
base: master
Are you sure you want to change the base?
Conversation
@abbot this PR includes the unit tests. Let me know if you would like any updates! (especially w.r.t. eliminating the |
@@ -79,7 +79,8 @@ func (da *DigestAuth) Purge(count int) { | |||
} | |||
cache := digestCache(entries) | |||
sort.Sort(cache) | |||
for _, client := range cache[:count] { |
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.
You could use min of count/len if you really want to remove count entries only
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.
@andig updated!
When the authenticator's cache is purged, there was a consistent
slice bounds out of range [:200] with capacity 181
panic occurring. Purging the entire cache resolves this error.This is moved over from #68, which is closed.