Skip to content

Commit

Permalink
Improve satori client
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviofernandes004 committed Jul 31, 2023
1 parent eff9544 commit e31a82c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions internal/satori/satori.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ func (s *SatoriClient) Authenticate(ctx context.Context, id string) error {
return err
}

defer res.Body.Close()

switch res.StatusCode {
case 200:
return nil
Expand Down Expand Up @@ -198,6 +200,8 @@ func (s *SatoriClient) PropertiesGet(ctx context.Context, id string) (*runtime.P
return nil, err
}

defer res.Body.Close()

switch res.StatusCode {
case 200:
resBody, err := io.ReadAll(res.Body)
Expand Down Expand Up @@ -251,6 +255,8 @@ func (s *SatoriClient) PropertiesUpdate(ctx context.Context, id string, properti
return err
}

defer res.Body.Close()

switch res.StatusCode {
case 200:
return nil
Expand Down Expand Up @@ -315,6 +321,8 @@ func (s *SatoriClient) EventsPublish(ctx context.Context, id string, events []*r
return err
}

defer res.Body.Close()

switch res.StatusCode {
case 200:
return nil
Expand Down Expand Up @@ -361,6 +369,8 @@ func (s *SatoriClient) ExperimentsList(ctx context.Context, id string, names ...
return nil, err
}

defer res.Body.Close()

switch res.StatusCode {
case 200:
resBody, err := io.ReadAll(res.Body)
Expand Down Expand Up @@ -417,6 +427,8 @@ func (s *SatoriClient) FlagsList(ctx context.Context, id string, names ...string
return nil, err
}

defer res.Body.Close()

switch res.StatusCode {
case 200:
resBody, err := io.ReadAll(res.Body)
Expand Down Expand Up @@ -473,6 +485,8 @@ func (s *SatoriClient) LiveEventsList(ctx context.Context, id string, names ...s
return nil, err
}

defer res.Body.Close()

switch res.StatusCode {
case 200:
resBody, err := io.ReadAll(res.Body)
Expand Down
4 changes: 2 additions & 2 deletions vendor/github.com/heroiclabs/nakama-common/runtime/runtime.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e31a82c

Please sign in to comment.