tell users they can't go higher than 5 minutes (#202)

* tell users they can't go higer than 5 minutes

* Update version in namespace.go

Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
This commit is contained in:
Paul Miller 2021-01-26 09:23:57 -08:00 коммит произвёл GitHub
Родитель 78c960db00
Коммит 12810d63bc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -26,6 +26,9 @@ import (
"context"
"crypto/tls"
"fmt"
"runtime"
"strings"
"github.com/Azure/azure-amqp-common-go/v3/aad"
"github.com/Azure/azure-amqp-common-go/v3/auth"
"github.com/Azure/azure-amqp-common-go/v3/cbs"
@ -34,8 +37,6 @@ import (
"github.com/Azure/go-amqp"
"github.com/Azure/go-autorest/autorest/azure"
"nhooyr.io/websocket"
"runtime"
"strings"
)
const (
@ -48,7 +49,7 @@ const (
//`
// Version is the semantic version number
Version = "0.10.7"
Version = "0.10.9"
rootUserAgent = "/golang-service-bus"

Просмотреть файл

@ -4,6 +4,7 @@ import (
"context"
"encoding/xml"
"errors"
"fmt"
"io/ioutil"
"net/http"
"strings"
@ -512,6 +513,10 @@ func SubscriptionWithLockDuration(window *time.Duration) SubscriptionManagementO
duration := time.Duration(1 * time.Minute)
window = &duration
}
if *window > time.Duration(5*time.Minute) {
return fmt.Errorf("Lock duration must be shorter than 5 minutes got: %v", *window)
}
s.LockDuration = ptrString(durationTo8601Seconds(*window))
return nil
}