Skip to content

Commit 0dbb7eb

Browse files
authored
Log date of finished download counts processing (#8074)
1 parent 227bbf1 commit 0dbb7eb

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/lib/service/download_counts/sync_download_counts.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Future<Set<String>> processDownloadCounts(DateTime date) async {
7272
}
7373

7474
final processedPackages = <String>{};
75+
final processedPackagesWithErrors = <String>{};
7576
final pool = Pool(10);
7677
for (final f in bucketEntries) {
7778
final fileName = f.name;
@@ -169,6 +170,7 @@ Future<Set<String>> processDownloadCounts(DateTime date) async {
169170
'$package-$version appeared in download counts data but does'
170171
' not exist');
171172
}
173+
processedPackagesWithErrors.add(package);
172174
}
173175
});
174176

@@ -183,6 +185,7 @@ Future<Set<String>> processDownloadCounts(DateTime date) async {
183185
'Package $package appeared in download counts data for file '
184186
'$fileName but does not exist.\n'
185187
'Error: $e');
188+
processedPackagesWithErrors.add(package);
186189
return;
187190
} // else {
188191
// The package is either invisible, tombstoned or has no versions.
@@ -215,6 +218,12 @@ Future<Set<String>> processDownloadCounts(DateTime date) async {
215218
});
216219
}));
217220

221+
final filesString = bucketEntries.length == 1 ? 'file' : 'files';
222+
_logger.info('Finished processing download counts for date $date:');
223+
_logger.info(' - ${failedFiles.length} out of ${bucketEntries.length} '
224+
'$filesString failed during processing.');
225+
_logger.info(' - ${processedPackages.length} packages processed including '
226+
'${processedPackagesWithErrors.length} packages with errors.');
218227
return failedFiles;
219228
}
220229

app/test/service/download_counts/download_counts_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,8 @@ void main() {
376376
} finally {
377377
await subscription.cancel();
378378
}
379-
380379
expect(
381-
messages.first,
380+
messages[messages.length - 2],
382381
contains('Failed to read any files with prefix '
383382
'"daily_download_counts/'
384383
'${formatDateForFileName(skippedDate)}'

0 commit comments

Comments
 (0)