feat: support sleep constant time

This commit is contained in:
lilong.129
2023-06-05 22:05:34 +08:00
parent 974f5ee18a
commit 38820a869a
4 changed files with 42 additions and 13 deletions
+5 -2
View File
@@ -542,8 +542,11 @@ func convertToFloat64(val interface{}) (float64, error) {
}
func sleepRandom(params []interface{}) error {
// append default weight 1
if len(params) == 2 {
if len(params) == 1 {
// constant sleep time
params = append(params, params[0], 1.0)
} else if len(params) == 2 {
// append default weight 1
params = append(params, 1.0)
}