@@ -96,19 +96,18 @@ void RunAll(std::vector<std::string> const& argv) {
96
96
// once every two seconds. We will pause until that time before deleting the
97
97
// bucket.
98
98
auto constexpr kBucketPeriod = std::chrono::seconds (2 );
99
- auto pause = std::chrono::steady_clock::now () + kBucketPeriod ;
100
99
(void )client
101
100
.CreateBucketForProject (
102
101
bucket_name_enabled, project_id,
103
102
gcs::BucketMetadata{}.set_autoclass (gcs::BucketAutoclass{true }))
104
103
.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 );
107
105
(void )client
108
106
.CreateBucketForProject (
109
107
bucket_name_disabled, project_id,
110
108
gcs::BucketMetadata{}.set_autoclass (gcs::BucketAutoclass{false }))
111
109
.value ();
110
+ auto const pause = std::chrono::steady_clock::now () + kBucketPeriod ;
112
111
113
112
std::cout << " \n Running GetAutoclass() example [enabled]" << std::endl;
114
113
GetAutoclass (client, {bucket_name_enabled});
@@ -121,6 +120,7 @@ void RunAll(std::vector<std::string> const& argv) {
121
120
122
121
if (!examples::UsingEmulator ()) std::this_thread::sleep_until (pause);
123
122
(void )examples::RemoveBucketAndContents (client, bucket_name_enabled);
123
+ if (!examples::UsingEmulator ()) std::this_thread::sleep_for (kBucketPeriod );
124
124
(void )examples::RemoveBucketAndContents (client, bucket_name_disabled);
125
125
}
126
126
0 commit comments