Skip to content

Commit

Permalink
Fix subscriber logic
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanjuan committed Oct 17, 2023
1 parent 5b5f00f commit ec23b97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func NewHTTPSubscriber(remoteURL, localFile string, interval time.Duration) (*HT
if err != nil {
return nil, err
}
}
if err != nil {
} else if err != nil {
return nil, err
}

Expand Down
5 changes: 4 additions & 1 deletion subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ func TestHTTPSubscriber(t *testing.T) {
localFile := "test-local-file.txt"
defer os.Remove(localFile)

subscriber := NewHTTPSubscriber(remoteServer.URL, localFile, 500*time.Millisecond)
subscriber, err := NewHTTPSubscriber(remoteServer.URL, localFile, 500*time.Millisecond)
if err != nil {
t.Fatal(err)
}
go subscriber.Subscribe()

// Allow some time for subscription to run
Expand Down

0 comments on commit ec23b97

Please sign in to comment.