[ARVADOS] created: 2.1.0-669-gf174df662

Git user git at public.arvados.org
Fri Apr 16 13:59:50 UTC 2021


        at  f174df662bf6a7dcc2c65921349418b428e04f6c (commit)


commit f174df662bf6a7dcc2c65921349418b428e04f6c
Author: Tom Clegg <tom at curii.com>
Date:   Fri Apr 16 09:59:01 2021 -0400

    17529: Heed MaxCloudOpsPerSecond in Instances() and returned insts.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/dispatchcloud/driver.go b/lib/dispatchcloud/driver.go
index 462c3683f..5fcc0903f 100644
--- a/lib/dispatchcloud/driver.go
+++ b/lib/dispatchcloud/driver.go
@@ -55,6 +55,15 @@ type rateLimitedInstanceSet struct {
 	ticker *time.Ticker
 }
 
+func (is rateLimitedInstanceSet) Instances(tags cloud.InstanceTags) ([]cloud.Instance, error) {
+	<-is.ticker.C
+	insts, err := is.InstanceSet.Instances(tags)
+	for i, inst := range insts {
+		insts[i] = &rateLimitedInstance{inst, is.ticker}
+	}
+	return insts, err
+}
+
 func (is rateLimitedInstanceSet) Create(it arvados.InstanceType, image cloud.ImageID, tags cloud.InstanceTags, init cloud.InitCommand, pk ssh.PublicKey) (cloud.Instance, error) {
 	<-is.ticker.C
 	inst, err := is.InstanceSet.Create(it, image, tags, init, pk)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list