File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1212 * the License.
1313 */
1414
15+ import java .time .Duration ;
16+
1517import com .couchbase .client .core .error .BucketExistsException ;
18+ import com .couchbase .client .java .Bucket ;
1619import com .couchbase .client .java .Cluster ;
1720import com .couchbase .client .java .manager .bucket .BucketManager ;
1821import com .couchbase .client .java .manager .bucket .BucketSettings ;
@@ -44,6 +47,10 @@ public static void main(String[] args) {
4447 System .out .println ("Bucket already exists" );
4548 }
4649 // end::createBucket[]
50+
51+ // Wait until bucket is created before trying to flush it
52+ Bucket bucket = cluster .bucket ("hello" );
53+ bucket .waitUntilReady (Duration .ofSeconds (10 ));
4754 }
4855
4956 {
@@ -59,6 +66,7 @@ public static void main(String[] args) {
5966 {
6067 System .out .println ("[flushBucket]" );
6168
69+
6270 // tag::flushBucket[]
6371 bucketMgr .flushBucket ("hello" );
6472 // end::flushBucket[]
You can’t perform that action at this time.
0 commit comments