File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -115,10 +115,11 @@ class TarballStorage {
115115 return ContentMatchStatus .different;
116116 }
117117 // Limit memory use while doing the byte-to-byte comparison by streaming it chunk-wise.
118- final raf = await file.open ();
119- var remainingLength = info.length;
120- try {
121- await _canonicalBucket.readWithRetry (objectName, (input) async {
118+ var remainingLength = - 1 ;
119+ await _canonicalBucket.readWithRetry (objectName, (input) async {
120+ final raf = await file.open ();
121+ remainingLength = info.length;
122+ try {
122123 await for (final chunk in input) {
123124 if (chunk.isEmpty) continue ;
124125 remainingLength -= chunk.length;
@@ -131,10 +132,10 @@ class TarballStorage {
131132 return ContentMatchStatus .different;
132133 }
133134 }
134- });
135- } finally {
136- await raf. close ();
137- }
135+ } finally {
136+ await raf. close ();
137+ }
138+ });
138139 if (remainingLength != 0 ) {
139140 return ContentMatchStatus .different;
140141 }
You can’t perform that action at this time.
0 commit comments