Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for IntN (0.26 sec)

  1. internal/http/server.go

    	if err != nil {
    		return err
    	}
    
    	pollIntervalBase := time.Millisecond
    	nextPollInterval := func() time.Duration {
    		// Add 10% jitter.
    		interval := pollIntervalBase + time.Duration(rand.Intn(int(pollIntervalBase/10)))
    		// Double and clamp for next time.
    		pollIntervalBase *= 2
    		if pollIntervalBase > shutdownPollIntervalMax {
    			pollIntervalBase = shutdownPollIntervalMax
    		}
    		return interval
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Feb 09 21:25:16 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  2. cmd/iam.go

    					logger.Info("IAM expired STS purge took %.2fs", took)
    				}
    			}
    
    			// The following actions are performed about once in 4 times that
    			// IAM is refreshed:
    			if r.Intn(4) == 0 {
    				// Poll and remove accounts for those users who were removed
    				// from LDAP/OpenID.
    				if sys.LDAPConfig.Enabled() {
    					sys.purgeExpiredCredentialsForLDAP(ctx)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 25 21:28:16 GMT 2024
    - 71.1K bytes
    - Viewed (1)
  3. cmd/test-utils_test.go

    // fetches a random number between range min-max.
    func getRandomRange(min, max int, seed int64) int {
    	// special value -1 means no explicit seeding.
    	if seed != -1 {
    		rand.Seed(seed)
    	}
    	return rand.Intn(max-min) + min
    }
    
    // Randomizes the order of bytes in the byte array
    // using Knuth Fisher-Yates shuffle algorithm.
    func randomizeBytes(s []byte, seed int64) []byte {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri May 03 17:26:51 GMT 2024
    - 76.2K bytes
    - Viewed (0)
  4. cmd/xl-storage-format_test.go

    					if err != nil {
    						b.Fatal(err)
    					}
    					// Update modtime for resorting...
    					fi.ModTime = fi.ModTime.Add(-time.Second)
    					// Update a random version.
    					fi.VersionID = ids[rng.Intn(size)]
    					// Update...
    					err = xl.UpdateObjectVersion(fi)
    					if err != nil {
    						b.Fatal(err)
    					}
    					// Save...
    					dump, err = xl.AppendTo(dump[:0])
    					if err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 17.6K bytes
    - Viewed (0)
  5. cmd/object-api-utils.go

    	rng := rand.New(rand.NewSource(time.Now().UTC().UnixNano()))
    	var d net.Dialer
    	var retry int
    	for retry < len(hosts) {
    		ctx, cancel := context.WithTimeout(GlobalContext, 300*time.Millisecond)
    
    		host = hosts[rng.Intn(len(hosts))]
    		conn, err := d.DialContext(ctx, "tcp", host)
    		cancel()
    		if err != nil {
    			retry++
    			continue
    		}
    		conn.Close()
    		break
    	}
    
    	return host
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Mar 11 11:55:34 GMT 2024
    - 35.6K bytes
    - Viewed (1)
  6. cmd/object-api-multipart_test.go

    		t.Fatalf("%s : %s", instanceType, err.Error())
    	}
    
    	z := obj.(*erasureServerPools)
    	er := z.serverPools[0].sets[0]
    
    	erasureDisks := er.getDisks()
    	ridx := rand.Intn(len(erasureDisks))
    
    	z.serverPools[0].erasureDisksMu.Lock()
    	er.getDisks = func() []StorageAPI {
    		erasureDisks[ridx] = newNaughtyDisk(erasureDisks[ridx], nil, errFaultyDisk)
    		return erasureDisks
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 77.1K bytes
    - Viewed (0)
Back to top