better throttle

Signed-off-by: Jess Frazelle <acidburn@google.com>
This commit is contained in:
Jess Frazelle 2017-03-04 22:51:56 -08:00
parent cf4c3ce4bc
commit 4160bcbf52
No known key found for this signature in database
GPG key ID: 18F3685C0022BFF3

View file

@ -234,7 +234,7 @@ func createStaticIndex(r *registry.Registry, staticDir, clairURI string) error {
go func(repo, tag string, i, j int) {
defer wg.Done()
throttle := time.Tick(time.Duration(time.Duration(i*j) * time.Microsecond))
throttle := time.Tick(time.Duration(time.Duration((i+1)*(j+1)) * time.Microsecond))
<-throttle
logrus.Infof("creating vulns.txt for %s:%s", repo, tag)