Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BatchClientFactory
- {
- private IBatchClientConfigurationSettingsRetriever batchClientConfigurationSettings;
- private BatchClient batchClient;
- public BatchClientFactory(IBatchClientConfigurationSettingsRetriever configurationSettingsRetriever)
- {
- this.batchClientConfigurationSettings = configurationSettingsRetriever;
- }
- public BatchClient GetBatchClientWithRetry()
- {
- var retry = new Microsoft.Azure.Batch.RetryPolicyProvider(new ExponentialRetry(TimeSpan.FromSeconds(10), 10));
- this.batchClient = BatchClient.Open(
- new BatchSharedKeyCredentials(
- batchClientConfigurationSettings.GetBatchAccountUri().AbsoluteUri,
- batchClientConfigurationSettings.BatchAccountName,
- batchClientConfigurationSettings.BatchAccountKey));
- batchClient.CustomBehaviors.Add(retry);
- return batchClient;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement