diff --git a/pkg/pub_worker/lib/src/analyze.dart b/pkg/pub_worker/lib/src/analyze.dart index bba97a315..60c1413c2 100644 --- a/pkg/pub_worker/lib/src/analyze.dart +++ b/pkg/pub_worker/lib/src/analyze.dart @@ -164,13 +164,6 @@ Future _analyzePackage( log.writeln('STOPPED: ${clock.now().toUtc().toIso8601String()}'); } - // Upload results, if there is any - _log.info('api.taskUploadResult("$package", "$version")'); - final r = await retry( - () => api.taskUploadResult(package, version), - retryIf: _retryIf, - ); - // Create a file to store the blob, and add everything to it. final blobFile = File(p.join(tempDir.path, 'files.blob')); final builder = IndexedBlobBuilder(blobFile.openWrite()); @@ -201,6 +194,13 @@ Future _analyzePackage( logFile.openRead().transform(gzip.encoder), ); + // Upload results, if there is any + _log.info('api.taskUploadResult("$package", "$version")'); + final r = await retry( + () => api.taskUploadResult(package, version), + retryIf: _retryIf, + ); + // Create BlobIndex final index = await builder.buildIndex(r.blobId);