var policy=await CloudClient.GetAccountPolicies(_accountInfo);\r
\r
StatusNotification.NotifyAccount(policy);\r
- EnsurePithosContainers();\r
+ await EnsurePithosContainers().ConfigureAwait(false);\r
\r
StatusKeeper.BlockHash = _blockHash;\r
StatusKeeper.BlockSize = _blockSize;\r
CleanupUnselectedStates();\r
}\r
\r
- private void EnsurePithosContainers()\r
+ private async Task EnsurePithosContainers()\r
{\r
\r
//Create the two default containers if they are missing\r
foreach (var container in pithosContainers)\r
{\r
var escapedUri = container.ToEscapedUri();\r
- var info=CloudClient.GetContainerInfo(UserName, escapedUri);\r
+ var info=await CloudClient.GetContainerInfo(UserName, escapedUri).ConfigureAwait(false);\r
if (info == ContainerInfo.Empty)\r
{\r
- CloudClient.CreateContainer(UserName, escapedUri);\r
- info = CloudClient.GetContainerInfo(UserName, escapedUri);\r
+ await CloudClient.CreateContainer(UserName, escapedUri);\r
+ info = await CloudClient.GetContainerInfo(UserName, escapedUri).ConfigureAwait(false);\r
}\r
_blockSize = info.BlockSize;\r
_blockHash = info.BlockHash;\r
return objectInfo;\r
}\r
\r
- public Task<ContainerInfo> GetContainerInfo(string filePath)\r
+ public async Task<ContainerInfo> GetContainerInfo(string filePath)\r
{\r
if (String.IsNullOrWhiteSpace(filePath))\r
throw new ArgumentNullException("filePath");\r
container = parts[0]; \r
}\r
\r
- return Task.Factory.StartNew(() =>\r
- {\r
- var client = new CloudFilesClient(accountInfo);\r
- var containerInfo = client.GetContainerInfo(accountName, container.ToEscapedUri());\r
- return containerInfo;\r
- });\r
+ \r
+ var client = new CloudFilesClient(accountInfo);\r
+ var containerInfo = await client.GetContainerInfo(accountName, container.ToEscapedUri()).ConfigureAwait(false);\r
+ return containerInfo;\r
+ \r
}\r
}\r
}\r