-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
pathInfoCache: Respect disk cache TTLs #3398 #3403
pathInfoCache: Respect disk cache TTLs #3398 #3403
Conversation
src/libstore/store-api.hh
Outdated
// Past tense, because a path can only be assumed to exists when | ||
// isKnownNow() && didExist() | ||
inline bool didExist() { | ||
return value != 0; |
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.
=> nullptr
.
src/libstore/store-api.hh
Outdated
|
||
PathInfoCacheValue(std::shared_ptr<const ValidPathInfo> value) : | ||
time_point(std::chrono::steady_clock::now()), | ||
value(value) {} |
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.
Since we're using C++20 now, constructors for "trivial" data classes can be omitted using designated initializers, e.g.
PathInfoCacheValue { .value = some_value }
and time_point
could have a default initializer:
std::chrono::time_point<std::chrono::steady_clock> time_point = std::chrono::steady_clock::now();
src/libstore/store-api.cc
Outdated
throw InvalidPath("path '%s' is not valid", printStorePath(storePath)); | ||
return callback(ref<const ValidPathInfo>(*res)); | ||
callback(ref<const ValidPathInfo>(res->value)); |
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.
Hm, removing the return looks potentially wrong...
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.
Yes it was. The compiler was complaining about return
in a void
function. I've re-added the return and then it works.
7e6fdb9
to
22e5b50
Compare
22e5b50
to
3f55f8a
Compare
Ready for review. I'll make a PR with the previous variation for a 2.3 backport. |
No description provided.