Skip to content

Commit

Permalink
Clone the Azure projects one by one, not parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
HusseinDossoki committed May 1, 2023
1 parent 1105075 commit 6ff3cfe
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/stores/AzureToAzureStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,20 @@ export const useAzureToAzureStore = defineStore("azureToAzureStore", {
},
async submit() {

this.selectedProjects.map(x => x.name).forEach(productName => {
let projectsNames = this.selectedProjects.map(x => x.name);

for (let i = 0; i < projectsNames.length; i++) {
const productName = projectsNames[i];

let product = this.srcProjects.find(x => x.name == productName);
product.timerCount = 0;
product.timer = setInterval(() => {
product.timerCount++;
}, 1000);
product.status = "inprogress";

invoke("sync_azure_devops_project",
try {
await invoke("sync_azure_devops_project",
{
params: {
src_project_ref: {
Expand All @@ -111,19 +116,17 @@ export const useAzureToAzureStore = defineStore("azureToAzureStore", {
},
create_project_if_not_exist: this.createProjectIfNotExist
}
})
.then((res) => {
clearInterval(product.timer);
product.status = "completed";
})
.catch((err) => {
clearInterval(product.timer);
product.status = "failed";
product.error = err;
});

});
clearInterval(product.timer);
product.status = "completed";
} catch(err) {
clearInterval(product.timer);
product.status = "failed";
product.error = err;
}

}

},
checkAll() {
Expand Down

0 comments on commit 6ff3cfe

Please sign in to comment.