Skip to content

Commit

Permalink
Reconnect to SF if errors occur
Browse files Browse the repository at this point in the history
Also does the following:

  * updates all workflows to use go 1.16.x since go.mod expects that
  * updates simpleforce dependency

Resolves: canonical#51
  • Loading branch information
dosaboy committed Aug 24, 2023
1 parent 4cca2e3 commit 801b259
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ghcr-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.15.x
go-version: 1.16.x

- name: Test and Build
run: make all
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
test:
strategy:
matrix:
go-version: [ 1.14.x, 1.15.x ]
go-version: [ 1.16.x ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.14.x, 1.15.x]
go-version: [1.16.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -18,4 +18,4 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Test and Build
run: make all
run: make all
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,6 @@ github.com/sanity-io/litter v1.2.0/go.mod h1:JF6pZUFgu2Q0sBZ+HSV35P8TVPI1TTzEwyu
github.com/segmentio/kafka-go v0.3.7/go.mod h1:8rEphJEczp+yDE/R5vwmaqZgF1wllrl4ioQcNKB8wVA=
github.com/segmentio/ksuid v1.0.3 h1:FoResxvleQwYiPAVKe1tMUlEirodZqlqglIuFsdDntY=
github.com/segmentio/ksuid v1.0.3/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE=
github.com/simpleforce/simpleforce v0.0.0-20210422092246-451f45b10354 h1:RyWGfGPc4X9d4LIApBIMM3GTQ7i6iYujnw2qfVUri4Q=
github.com/simpleforce/simpleforce v0.0.0-20210422092246-451f45b10354/go.mod h1:abS7k7nPhcNtzsAsfzOedGmI7yU0PDzQVwlHJZwGgOs=
github.com/simpleforce/simpleforce v0.0.0-20211207104336-af9d9a281fea h1:U1R5zYZiav6wjwrnNVKk1FgikIetLx0sQfQfk40N1qY=
github.com/simpleforce/simpleforce v0.0.0-20211207104336-af9d9a281fea/go.mod h1:smilciuVOz+ftYBgSskSZp/a+xLyp34dmm7RWmFMDBw=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
Expand Down
10 changes: 10 additions & 0 deletions pkg/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ func (runner *ReportRunner) UploadAndSaveReport(report *ReportToExecute, caseNum

logrus.Infof("Getting case from salesforce number: %s", caseNumber)
sfCase, err := runner.SalesforceClient.GetCaseByNumber(caseNumber)
if err != nil {
logrus.Warn("Creating new SF client since current one is failing")
client, client_err := common.NewSalesforceClient(runner.Config)
if client_err != nil {
logrus.Warn("Failed to reconnect to salesforce")
return err
}
runner.SalesforceClient = client
sfCase, err = runner.SalesforceClient.GetCaseByNumber(caseNumber)
}
if err != nil {
return err
}
Expand Down

0 comments on commit 801b259

Please sign in to comment.