Skip to content

Commit

Permalink
fix get records of type (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcajmagic authored Jan 30, 2020
1 parent 2c9bfbf commit 777c3e9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [v0.12.2]
- updated long-poll status codes [#103](https://github.com/xmidt-org/gungnir/pull/103)
- fixed long-poll first get [#104](https://github.com/xmidt-org/gungnir/pull/104)
- updated codex-db to v0.5.1 [#104](https://github.com/xmidt-org/gungnir/pull/104)

## [v0.12.1]
- Add timeouts to long-poll [#102](https://github.com/xmidt-org/gungnir/pull/102)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/stretchr/testify v1.4.0
github.com/ugorji/go/codec v1.1.7
github.com/xmidt-org/bascule v0.7.0
github.com/xmidt-org/codex-db v0.5.0
github.com/xmidt-org/codex-db v0.5.1
github.com/xmidt-org/voynicrypto v0.1.1
github.com/xmidt-org/webpa-common v1.5.1
github.com/xmidt-org/wrp-go v1.3.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ github.com/xmidt-org/bascule v0.5.0/go.mod h1:D2DuXSMa5+OpveCtaSWp0+/tmnxZqfYhkC
github.com/xmidt-org/bascule v0.7.0 h1:TUbSKq68CzutTXYh5hq8mhMCHeYdIXaUffx3qCMo1yE=
github.com/xmidt-org/bascule v0.7.0/go.mod h1:D2DuXSMa5+OpveCtaSWp0+/tmnxZqfYhkCC1oCzLZdI=
github.com/xmidt-org/capacityset v0.1.1/go.mod h1:rJ00PZmbkdroZMiL0DOMzgkrwJddVfR1I5LmRX6YG2Y=
github.com/xmidt-org/codex-db v0.5.0 h1:TFFzuSwtV0pubtKeqjAsk/qXG4d36Dqwf4Hdr42qt8c=
github.com/xmidt-org/codex-db v0.5.0/go.mod h1:vQpkbRzvaOCpiObVv8e5vRHgW08w1o8J1GtgRheulwk=
github.com/xmidt-org/codex-db v0.5.1 h1:n3NCsR0npQDLGd0ZndnrjCwei3vY3Zs09ypGU61KYRw=
github.com/xmidt-org/codex-db v0.5.1/go.mod h1:vQpkbRzvaOCpiObVv8e5vRHgW08w1o8J1GtgRheulwk=
github.com/xmidt-org/voynicrypto v0.1.1 h1:hMqSOgYzpkbUUpgKxJcPTVRGdmDY0jem8PufsUikh+c=
github.com/xmidt-org/voynicrypto v0.1.1/go.mod h1:YSw/rwukAL2tpkB6wSeuoCRBOIK2mhpV4OzJLX292fs=
github.com/xmidt-org/webpa-common v1.1.0/go.mod h1:oCpKzOC+9h2vYHVzAU/06tDTQuBN4RZz+rhgIXptpOI=
Expand Down
6 changes: 6 additions & 0 deletions primaryHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ func (app *App) getDeviceInfoAfterHash(deviceID string, requestHash string, ctx
http.StatusInternalServerError}
}

hash, err = app.eventGetter.GetStateHash(records)
if err != nil {
logging.Error(app.logger, emperror.Context(err)...).Log(logging.MessageKey(), "Failed to get latest hash from records", logging.ErrorKey(), err.Error())
}
events = app.parseRecords(records)

after := time.After(app.longPollTimeout)
// TODO: improve long poll logic
for len(events) == 0 {
Expand Down

0 comments on commit 777c3e9

Please sign in to comment.