Skip to content

Commit

Permalink
fix(grpc): allow messages over 4MB
Browse files Browse the repository at this point in the history
  • Loading branch information
avermeil committed May 21, 2019
1 parent 798dde2 commit baa8646
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,18 @@ export class GoogleAdsClient {
const serviceClientConstructor = (services as any)[serviceClientName];

const service = new serviceClientConstructor(
GOOGLE_ADS_ENDPOINT,
GOOGLE_ADS_ENDPOINT,
grpc.credentials.createSsl(),
{
interceptors,
}
/*
By default, the maximum size of a gRPC message is 4MB.
Google Ads results can sometimes be quite big, so 4MB can be insufficient.
Here, we set it to 1GB to essentially remove that limit.
*/
'grpc.max_send_message_length': 1024 * 1024 * 1024,
'grpc.max_receive_message_length': 1024 * 1024 * 1024
},
);

/* Promisify gRPC service methods (callbacks are kept as well) */
Expand Down

0 comments on commit baa8646

Please sign in to comment.