Skip to content

Commit

Permalink
make ensure org less intrusive
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed Mar 21, 2024
1 parent 205ed46 commit d11c725
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async function mirror(repository, gitea, giteaUser, githubToken, giteaOwner) {
return;
}
console.log('Mirroring repository to gitea: ', repository.name);
await ensureOrg(gitea, giteaOwner,() => mirrorOnGitea(repository, gitea, giteaUser, githubToken, giteaOwner));
await mirrorOnGitea(repository, gitea, giteaUser, githubToken, giteaOwner);
}

async function createMirrorsOnGitea(githubRepositories, githubUsername) {
Expand All @@ -140,13 +140,15 @@ async function createMirrorsOnGitea(githubRepositories, githubUsername) {
token: giteaToken,
};
const giteaUser = await getGiteaUser(gitea);

const queue = new PQueue({ concurrency: 1 });
await queue.addAll(githubRepositories.map(repository => {
return async () => {
await mirror(repository, gitea, giteaUser, githubToken, githubUsername);
};
}));
ensureOrg(gitea, giteaOwner,() => {
const queue = new PQueue({ concurrency: 1 });
await queue.addAll(githubRepositories.map(repository => {
return async () => {
await mirror(repository, gitea, giteaUser, githubToken, githubUsername);
};
}));

})

}

Expand Down

0 comments on commit d11c725

Please sign in to comment.