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 {
115
115
return ContentMatchStatus .different;
116
116
}
117
117
// 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 {
122
123
await for (final chunk in input) {
123
124
if (chunk.isEmpty) continue ;
124
125
remainingLength -= chunk.length;
@@ -131,10 +132,10 @@ class TarballStorage {
131
132
return ContentMatchStatus .different;
132
133
}
133
134
}
134
- });
135
- } finally {
136
- await raf. close ();
137
- }
135
+ } finally {
136
+ await raf. close ();
137
+ }
138
+ });
138
139
if (remainingLength != 0 ) {
139
140
return ContentMatchStatus .different;
140
141
}
You can’t perform that action at this time.
0 commit comments