Created
February 21, 2018 13:23
-
-
Save Lorac/6cef9747e6e668e99b4c246bfe8d9408 to your computer and use it in GitHub Desktop.
Ratelimit gitlab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
gitlab "github.com/xanzy/go-gitlab" | |
) | |
func main() { | |
// See the separate files in this directory for the examples. This file is only | |
// here to provide a main() function for the `example` package, keeping Travis happy. | |
git := gitlab.NewClient(nil, "") | |
var wg sync.WaitGroup | |
wg.Add(5) | |
go func() { | |
defer wg.Done() | |
for i := 0; i < 650; i++ { | |
_, resp, err := git.Projects.GetProject(13083) // Get GitlabProject | |
fmt.Println(resp.Header) | |
fmt.Println(resp) | |
fmt.Println(err) | |
} | |
}() | |
go func() { | |
defer wg.Done() | |
for i := 0; i < 650; i++ { | |
_, resp, err := git.Projects.GetProject(13083) // Get GitlabProject | |
fmt.Println(resp.Header) | |
fmt.Println(resp) | |
fmt.Println(err) | |
} | |
}() | |
go func() { | |
defer wg.Done() | |
for i := 0; i < 650; i++ { | |
_, resp, err := git.Projects.GetProject(13083) // Get GitlabProject | |
fmt.Println(resp.Header) | |
fmt.Println(resp) | |
fmt.Println(err) | |
} | |
}() | |
go func() { | |
defer wg.Done() | |
for i := 0; i < 650; i++ { | |
_, resp, err := git.Projects.GetProject(13083) // Get GitlabProject | |
fmt.Println(resp.Header) | |
fmt.Println(resp) | |
fmt.Println(err) | |
} | |
}() | |
go func() { | |
defer wg.Done() | |
for i := 0; i < 650; i++ { | |
_, resp, err := git.Projects.GetProject(13083) // Get GitlabProject | |
fmt.Println(resp.Header) | |
fmt.Println(resp) | |
fmt.Println(err) | |
} | |
}() | |
wg.Wait() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment