-
Notifications
You must be signed in to change notification settings - Fork 153
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
Small changes on refactor APIKeyLastUseCache get #4216
Conversation
pkg/app/ops/apikeylastusedtimeupdater/apikeylastusedtimeupdater.go
Outdated
Show resolved
Hide resolved
pkg/app/ops/apikeylastusedtimeupdater/apikeylastusedtimeupdater.go
Outdated
Show resolved
Hide resolved
…r.go Co-authored-by: knanao <[email protected]>
…r.go Co-authored-by: knanao <[email protected]>
pkg/app/server/grpcapi/web_api.go
Outdated
if cachedLastUse, err := a.apiKeyLastUsedStore.Get(apiKeys[i].Id); err == nil { | ||
lastUsedAt, err = strconv.ParseInt(string(cachedLastUse.([]byte)), 10, 64) |
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.
[nits] This is also the same.
if cachedLastUse, err := a.apiKeyLastUsedStore.Get(apiKeys[i].Id); err == nil { | |
lastUsedAt, err = strconv.ParseInt(string(cachedLastUse.([]byte)), 10, 64) | |
if cachedLastUse, err := a.apiKeyLastUsedStore.Get(apiKeys[i].Id); err == nil { | |
s := string(cachedLastUse.([]byte) | |
lastUsedAt, err = strconv.ParseInt(s, 10, 64) |
pkg/app/server/grpcapi/web_api.go
Outdated
if cachedLastUse, err := a.apiKeyLastUsedStore.Get(apiKeys[i].Id); err == nil { | ||
lastUsedAt, err = strconv.ParseInt(string(cachedLastUse.([]byte)), 10, 64) | ||
if err != nil { | ||
a.logger.Error("failed to get last used time from cache", zap.Error(err)) |
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.
a.logger.Error("failed to get last used time from cache", zap.Error(err)) | |
a.logger.Error("failed to parse last used time from cache", zap.Error(err)) |
pkg/app/server/grpcapi/web_api.go
Outdated
lastUsedAt, err = strconv.ParseInt(string(cachedLastUse.([]byte)), 10, 64) | ||
if err != nil { | ||
a.logger.Error("failed to get last used time from cache", zap.Error(err)) | ||
} |
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.
We should check the 1532 line's error?
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.
Sure do, I updated this part 🙆♀️
Co-authored-by: knanao <[email protected]>
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.
Here you go!
What this PR does / why we need it:
Which issue(s) this PR fixes:
Follow #4201
Does this PR introduce a user-facing change?: