Skip to content

Commit

Permalink
use WithContext variant
Browse files Browse the repository at this point in the history
  • Loading branch information
EronWright committed Sep 30, 2022
1 parent 22b66b6 commit 6b0d41d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion command/event_orchestration_create.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"encoding/json"
"fmt"
"os"
Expand Down Expand Up @@ -60,7 +61,7 @@ func (c *EventOrchestrationCreate) Run(args []string) int {
return -1
}
log.Debugf("%#v", eo)
if _, err := client.CreateOrchestration(eo); err != nil {
if _, err := client.CreateOrchestrationWithContext(context.Background(), eo); err != nil {
log.Error(err)
return -1
}
Expand Down
3 changes: 2 additions & 1 deletion command/event_orchestration_list.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"fmt"
"strings"

Expand Down Expand Up @@ -53,7 +54,7 @@ func (c *EventOrchestrationList) Run(args []string) int {
opts := pagerduty.ListOrchestrationsOptions{
SortBy: sortBy,
}
if eps, err := client.ListOrchestrations(opts); err != nil {
if eps, err := client.ListOrchestrationsWithContext(context.Background(), opts); err != nil {
log.Error(err)
return -1
} else {
Expand Down
5 changes: 3 additions & 2 deletions command/event_orchestration_show.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"fmt"
"strings"

Expand Down Expand Up @@ -53,7 +54,7 @@ func (c *EventOrchestrationShow) Run(args []string) int {
}
client := c.Meta.Client()
o := &pagerduty.GetOrchestrationOptions{}
ep, err := client.GetOrchestration(eoID, o)
ep, err := client.GetOrchestrationWithContext(context.Background(), eoID, o)
if err != nil {
log.Error(err)
return -1
Expand All @@ -67,7 +68,7 @@ func (c *EventOrchestrationShow) Run(args []string) int {
fmt.Println("---")

ro := &pagerduty.GetOrchestrationRouterOptions{}
rules, err := client.GetOrchestrationRouter(eoID, ro)
rules, err := client.GetOrchestrationRouterWithContext(context.Background(), eoID, ro)
if err != nil {
log.Error(err)
return -1
Expand Down

0 comments on commit 6b0d41d

Please sign in to comment.