diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Store/GitStore.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Store/GitStore.cs index a94dfde87f4..1c2e8171e22 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Store/GitStore.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Store/GitStore.cs @@ -172,15 +172,19 @@ public async Task Push(string pathToAssetsJson) { public async Task Restore(string pathToAssetsJson) { var config = await ParseConfigurationFile(pathToAssetsJson); - var initialized = IsAssetsRepoInitialized(config); - - if (!initialized) + var restoreQueue = InitTasks.GetOrAdd("restore", new TaskQueue()); + restoreQueue.Enqueue(async () => { - InitializeAssetsRepo(config); - } + var initialized = IsAssetsRepoInitialized(config); - CheckoutRepoAtConfig(config, cleanEnabled: true); - await BreadCrumb.Update(config); + if (!initialized) + { + InitializeAssetsRepo(config); + } + + CheckoutRepoAtConfig(config, cleanEnabled: true); + await BreadCrumb.Update(config); + }); return config.AssetsRepoLocation.ToString(); }