Skip to content
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

fix: return cachego.ErrCacheExpired #26

Merged
merged 1 commit into from
May 8, 2023

Conversation

rfyiamcool
Copy link
Contributor

@rfyiamcool rfyiamcool commented May 7, 2023

what

I think return cachego.ErrCacheExpired when kv is expired,The business layer only needs to judge that the returned error is cachego.ErrCacheExpired.

res, err := cache.Fetch(key)
if err == cachego.ErrCacheExpired {
        value := dao.Select(key)
        cache.Save(key, value, 10 * time.Hour)
}
...

@faabiosr faabiosr self-requested a review May 8, 2023 12:16
Copy link
Owner

@faabiosr faabiosr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@faabiosr faabiosr merged commit ba1473f into faabiosr:master May 8, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants