Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit 12810d6

Browse files
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 <[email protected]>
1 parent 78c960d commit 12810d6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

namespace.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ import (
2626
"context"
2727
"crypto/tls"
2828
"fmt"
29+
"runtime"
30+
"strings"
31+
2932
"github.com/Azure/azure-amqp-common-go/v3/aad"
3033
"github.com/Azure/azure-amqp-common-go/v3/auth"
3134
"github.com/Azure/azure-amqp-common-go/v3/cbs"
@@ -34,8 +37,6 @@ import (
3437
"github.com/Azure/go-amqp"
3538
"github.com/Azure/go-autorest/autorest/azure"
3639
"nhooyr.io/websocket"
37-
"runtime"
38-
"strings"
3940
)
4041

4142
const (
@@ -48,7 +49,7 @@ const (
4849
//`
4950

5051
// Version is the semantic version number
51-
Version = "0.10.7"
52+
Version = "0.10.9"
5253

5354
rootUserAgent = "/golang-service-bus"
5455

subscription_manager.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/xml"
66
"errors"
7+
"fmt"
78
"io/ioutil"
89
"net/http"
910
"strings"
@@ -512,6 +513,10 @@ func SubscriptionWithLockDuration(window *time.Duration) SubscriptionManagementO
512513
duration := time.Duration(1 * time.Minute)
513514
window = &duration
514515
}
516+
if *window > time.Duration(5*time.Minute) {
517+
return fmt.Errorf("Lock duration must be shorter than 5 minutes got: %v", *window)
518+
}
519+
515520
s.LockDuration = ptrString(durationTo8601Seconds(*window))
516521
return nil
517522
}

0 commit comments

Comments
 (0)