@@ -496,31 +496,25 @@ export class RegistryChecks {
496
496
// Since the affected clients query is lighter it makes more sense to run it first and skip running
497
497
// the operations query if no clients are affected, as it will also yield zero results in that case.
498
498
499
- const topAffectedClients = await this . operationsReader . getTopClientsForSchemaCoordinate (
500
- {
499
+ const [ topAffectedClients , topAffectedOperations ] = await Promise . all ( [
500
+ this . operationsReader . getTopClientsForSchemaCoordinate ( {
501
501
targetIds : settings . targetIds ,
502
502
excludedClients : settings . excludedClientNames ,
503
503
period : settings . period ,
504
504
schemaCoordinate : change . breakingChangeSchemaCoordinate ,
505
- } ,
506
- ) ;
507
-
508
- if ( topAffectedClients ) {
509
- const topAffectedOperations =
510
- await this . operationsReader . getTopOperationsForSchemaCoordinate ( {
511
- targetIds : settings . targetIds ,
512
- excludedClients : settings . excludedClientNames ,
513
- period : settings . period ,
514
- schemaCoordinate : change . breakingChangeSchemaCoordinate ,
515
- } ) ;
516
-
517
- if ( topAffectedOperations ) {
518
- change . usageStatistics = {
519
- topAffectedOperations,
520
- topAffectedClients,
521
- } ;
522
- }
523
- }
505
+ } ) ,
506
+ this . operationsReader . getTopOperationsForSchemaCoordinate ( {
507
+ targetIds : settings . targetIds ,
508
+ excludedClients : settings . excludedClientNames ,
509
+ period : settings . period ,
510
+ schemaCoordinate : change . breakingChangeSchemaCoordinate ,
511
+ } ) ,
512
+ ] ) ;
513
+
514
+ change . usageStatistics = {
515
+ topAffectedOperations : topAffectedOperations ?? [ ] ,
516
+ topAffectedClients : topAffectedClients ?? [ ] ,
517
+ } ;
524
518
}
525
519
526
520
change . isSafeBasedOnUsage = ! isBreaking ;
0 commit comments