piceaTech / node-gitlab-2-github

Migrate Issues, milestones etc from gitlab to github
MIT License
547 stars 133 forks source link

"Abuse detected" slowdowns and possible solution #189

Open DavidGriffith opened 11 months ago

DavidGriffith commented 11 months ago

I have a fairly small repo with 229 issues that gets stalled around Issue 40 with the following message:

Migrating issue #40 ('[PLACEHOLDER] - for issue #40')...
Abuse detected for request POST /repos/{owner}/{repo}/issues
Retrying after 1000 seconds!

At this point I can leave it running for hours and it won't ever finish. Is there some way I can throttle back API usage or avoid this some other way? Stopping and restarting doesn't help as it 1) starts from the beginning again and 2) I hit the "Abuse detected" immediately. This has a side-effect of ticking off Github such that when I try to file an issue, it is rejected with There was an error creating your Issue: was submitted too quickly.

DavidGriffith commented 11 months ago

Putting a quick-and-dirty delay of ten seconds at the beginning of the for loop in transferIssues() seems to allow the transfer to take place without provoking Github's abuse-detector. I'm not sure what the shortest acceptable delay is -- hopefully a lot less because transferring https://github.com/DavidGriffith/minipro-import-test from Gitlab took a couple hours. Is simply sticking in a delay the right way to do this? If so, I'll polish this fix up and submit a pull request.

klausmcm commented 5 months ago

@DavidGriffith Could you please share a copy or at least a diff of your transferIssues() function with the delay? There are two for loops in that function. I guess the second loop is where the delay is?