Skip to content

Commit 8c16c06

Browse files
committed
Address review comments
1 parent d43921f commit 8c16c06

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

google/cloud/storage/examples/storage_bucket_autoclass_samples.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,18 @@ void RunAll(std::vector<std::string> const& argv) {
9696
// once every two seconds. We will pause until that time before deleting the
9797
// bucket.
9898
auto constexpr kBucketPeriod = std::chrono::seconds(2);
99-
auto pause = std::chrono::steady_clock::now() + kBucketPeriod;
10099
(void)client
101100
.CreateBucketForProject(
102101
bucket_name_enabled, project_id,
103102
gcs::BucketMetadata{}.set_autoclass(gcs::BucketAutoclass{true}))
104103
.value();
105-
if (!examples::UsingEmulator()) std::this_thread::sleep_until(pause);
106-
pause = std::chrono::steady_clock::now() + kBucketPeriod;
104+
if (!examples::UsingEmulator()) std::this_thread::sleep_for(kBucketPeriod);
107105
(void)client
108106
.CreateBucketForProject(
109107
bucket_name_disabled, project_id,
110108
gcs::BucketMetadata{}.set_autoclass(gcs::BucketAutoclass{false}))
111109
.value();
110+
auto const pause = std::chrono::steady_clock::now() + kBucketPeriod;
112111

113112
std::cout << "\nRunning GetAutoclass() example [enabled]" << std::endl;
114113
GetAutoclass(client, {bucket_name_enabled});
@@ -121,6 +120,7 @@ void RunAll(std::vector<std::string> const& argv) {
121120

122121
if (!examples::UsingEmulator()) std::this_thread::sleep_until(pause);
123122
(void)examples::RemoveBucketAndContents(client, bucket_name_enabled);
123+
if (!examples::UsingEmulator()) std::this_thread::sleep_for(kBucketPeriod);
124124
(void)examples::RemoveBucketAndContents(client, bucket_name_disabled);
125125
}
126126

google/cloud/storage/examples/storage_examples.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"""Automatically generated unit tests list - DO NOT EDIT."""
1818

1919
storage_examples = [
20-
"storage_bucket_autoclass_samples.cc",
2120
"storage_bucket_acl_samples.cc",
21+
"storage_bucket_autoclass_samples.cc",
2222
"storage_bucket_cors_samples.cc",
2323
"storage_bucket_default_kms_key_samples.cc",
2424
"storage_bucket_iam_samples.cc",

0 commit comments

Comments
 (0)