From 2a7a6e1d21cbd2c1df6c7593e99d115e5c31cf95 Mon Sep 17 00:00:00 2001 From: Rossil <40714231+Rossil2012@users.noreply.github.com> Date: Tue, 26 Sep 2023 17:02:33 +0800 Subject: [PATCH] add loop label Co-authored-by: Bohan Zhang --- src/connector/src/source/filesystem/s3_v2/lister.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/connector/src/source/filesystem/s3_v2/lister.rs b/src/connector/src/source/filesystem/s3_v2/lister.rs index 6a14cadbea9dd..ae466e72f6ea7 100644 --- a/src/connector/src/source/filesystem/s3_v2/lister.rs +++ b/src/connector/src/source/filesystem/s3_v2/lister.rs @@ -71,9 +71,9 @@ pub struct S3SourceLister { impl S3SourceLister { #[try_stream(boxed, ok = Vec, error = RwError)] async fn paginate_inner(self) { - loop { // start a new round + 'round: loop { // start a new round let mut next_continuation_token = None; - loop { // loop to paginate + 'truncated: loop { // loop to paginate let mut req = self .client .list_objects_v2() @@ -113,7 +113,7 @@ impl S3SourceLister { if res.is_truncated() { next_continuation_token = Some(res.next_continuation_token.unwrap()) } else { - break; + break 'truncated; } } }