Created
July 2, 2021 00:20
-
-
Save kcollasarundell/5481e092a7815d3860e8e38d11d4efab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SERVICE_CONFIG = json.dumps( | |
{ | |
"methodConfig": [ | |
{ | |
"name": [{"service": ""}], | |
"retryPolicy": { | |
"maxAttempts": 5, | |
"initialBackoff": "1s", | |
"maxBackoff": "15s", | |
"backoffMultiplier": 2, | |
"retryableStatusCodes": ["UNAVAILABLE"], | |
}, | |
} | |
], | |
"loadBalancingConfig": [{"round_robin": {}}], | |
} | |
) | |
if self.config.tf_retry: | |
options.append(("grpc.service_config", SERVICE_CONFIG)) | |
self.channel = grpc.insecure_channel("hostname", options=options) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment