From aaca5b90eeb5beb03938c1c44002795027f0d774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20So=C3=B3s?= Date: Mon, 30 Sep 2024 15:04:57 +0200 Subject: [PATCH] Move getting the blobId closer to its actual use. (#8087) --- pkg/pub_worker/lib/src/analyze.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/pub_worker/lib/src/analyze.dart b/pkg/pub_worker/lib/src/analyze.dart index bba97a3154..60c1413c28 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);