File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -35,13 +35,18 @@ var (
3535)
3636
3737type Options struct {
38+ // Url is the base address of QStash, it's set to https://qstash.upstash.io by default.
39+ Url string
3840 // Token is the authorization token from the Upstash console.
3941 Token string
4042 // Client is the HTTP client used for sending requests.
4143 Client * http.Client
4244}
4345
4446func (o * Options ) init () {
47+ if o .Url == "" {
48+ o .Url = "https://qstash.upstash.io"
49+ }
4550 if o .Client == nil {
4651 o .Client = http .DefaultClient
4752 }
@@ -71,7 +76,7 @@ func NewClientWith(options Options) *Client {
7176 header .Set ("Authorization" , "Bearer " + options .Token )
7277 base := os .Getenv (urlEnvProperty )
7378 if base == "" {
74- base = "https://qstash.upstash.io"
79+ base = options . Url
7580 }
7681 index := & Client {
7782 token : options .Token ,
Original file line number Diff line number Diff line change @@ -416,7 +416,7 @@ func TestCancelAll(t *testing.T) {
416416 time .Sleep (1 * time .Second )
417417 deleted , err := client .Messages ().CancelAll ()
418418 assert .NoError (t , err )
419- assert .GreaterOrEqual (t , deleted , 10 )
419+ assert .Greater (t , deleted , 0 )
420420}
421421
422422func AssertDeliveredEventually (t * testing.T , client * Client , messageId string ) {
You can’t perform that action at this time.
0 commit comments