Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ void UpdateAnywhereCache(
std::string const& admission_policy) {
google::storage::control::v2::AnywhereCache cache;
google::protobuf::FieldMask field_mask;
field_mask.add_paths("admission_policy");
field_mask.add_paths("ttl");
cache.set_name(cache_name);
cache.set_admission_policy(admission_policy);
cache->mutable_ttl()->set_seconds(86400);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The cache object is a value type, not a pointer. You should use the . operator to access its members instead of ->. Using the arrow operator here will cause a compilation error.

Additionally, with this change, the admission_policy parameter is no longer used. Consider removing it from the function signature to avoid compiler warnings and improve code clarity.

    cache.mutable_ttl()->set_seconds(86400);

// Start an update operation and block until it completes. Real applications
// may want to setup a callback, wait on a coroutine, or poll until it
// completes.
Expand Down