Skip to content

Commit

Permalink
fix(nordigen): add HTTP timeout
Browse files Browse the repository at this point in the history
Use forked Nordigen client with timeout to avoid hanging forever on
connections go nowhere.

Fixes #61
  • Loading branch information
martinohansen committed Jan 13, 2024
1 parent 0cc4653 commit b2a2c23
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.csv
*.env
*.json
.cache
3 changes: 3 additions & 0 deletions cmd/ynabber/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"
"time"

"github.com/carlmjohnson/versioninfo"
"github.com/kelseyhightower/envconfig"
"github.com/martinohansen/ynabber"
"github.com/martinohansen/ynabber/reader/nordigen"
Expand All @@ -15,6 +16,8 @@ import (
)

func main() {
log.Println("Version:", versioninfo.Short())

// Read config from env
var cfg ynabber.Config
err := envconfig.Process("", &cfg)
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module github.com/martinohansen/ynabber

go 1.21

require github.com/frieser/nordigen-go-lib/v2 v2.1.4

require github.com/kelseyhightower/envconfig v1.4.0

require github.com/carlmjohnson/versioninfo v0.22.5

require github.com/martinohansen/nordigen-go-lib/v2 v2.1.1-0.20240113131411-57fc6c590df0
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
github.com/frieser/nordigen-go-lib/v2 v2.1.4 h1:dg5uSCAONW7nPONcmzvMcqloj5I37gbMLk3YsEF3rMU=
github.com/frieser/nordigen-go-lib/v2 v2.1.4/go.mod h1:NejYisqD8GvynCN0vDGw7J66slnj7jB25c8tS1tr8bw=
github.com/carlmjohnson/versioninfo v0.22.5 h1:O00sjOLUAFxYQjlN/bzYTuZiS0y6fWDQjMRvwtKgwwc=
github.com/carlmjohnson/versioninfo v0.22.5/go.mod h1:QT9mph3wcVfISUKd0i9sZfVrPviHuSF+cUtLjm2WSf8=
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
github.com/martinohansen/nordigen-go-lib/v2 v2.1.1-0.20240113131411-57fc6c590df0 h1:pU+0ogcgVGwndZazPXyE7MVy6Kmco6Jfp4jK+HGgcWc=
github.com/martinohansen/nordigen-go-lib/v2 v2.1.1-0.20240113131411-57fc6c590df0/go.mod h1:hUd8YJRV7SyNGdPpv4JxR7HqF09gctMJqH0UOvvemtA=
2 changes: 1 addition & 1 deletion reader/nordigen/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strconv"
"time"

"github.com/frieser/nordigen-go-lib/v2"
"github.com/martinohansen/nordigen-go-lib/v2"
)

const RequisitionRedirect = "https://raw.githubusercontent.com/martinohansen/ynabber/main/ok.html"
Expand Down
2 changes: 1 addition & 1 deletion reader/nordigen/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"time"

"github.com/frieser/nordigen-go-lib/v2"
"github.com/martinohansen/nordigen-go-lib/v2"
"github.com/martinohansen/ynabber"
)

Expand Down
2 changes: 1 addition & 1 deletion reader/nordigen/mapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/frieser/nordigen-go-lib/v2"
"github.com/martinohansen/nordigen-go-lib/v2"
)

func TestParseAmount(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion reader/nordigen/nordigen.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"strings"

"github.com/frieser/nordigen-go-lib/v2"
"github.com/martinohansen/nordigen-go-lib/v2"
"github.com/martinohansen/ynabber"
)

Expand Down
2 changes: 1 addition & 1 deletion reader/nordigen/nordigen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"
"time"

"github.com/frieser/nordigen-go-lib/v2"
"github.com/kelseyhightower/envconfig"
"github.com/martinohansen/nordigen-go-lib/v2"
"github.com/martinohansen/ynabber"
)

Expand Down

0 comments on commit b2a2c23

Please sign in to comment.