Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
bump v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ipfans committed Dec 31, 2020
1 parent b16a2fc commit 977c03f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
## [Unreleased]


<a name="v0.2.0"></a>
## [v0.2.0] - 2020-12-30
### Features
- compensation mechanism for refresh token


<a name="v0.2.0-beta.1"></a>
## [v0.2.0-beta.1] - 2020-12-29
### Features
- ExponentialBackOff support for API.


<a name="v0.1.3"></a>
## [v0.1.3] - 2020-12-29
### Bug Fixes
Expand Down Expand Up @@ -50,7 +62,9 @@
- More powerful API Client


[Unreleased]: https://github.com/yunjuiot/tuyacloud/compare/v0.1.3...HEAD
[Unreleased]: https://github.com/yunjuiot/tuyacloud/compare/v0.2.0...HEAD
[v0.2.0]: https://github.com/yunjuiot/tuyacloud/compare/v0.2.0-beta.1...v0.2.0
[v0.2.0-beta.1]: https://github.com/yunjuiot/tuyacloud/compare/v0.1.3...v0.2.0-beta.1
[v0.1.3]: https://github.com/yunjuiot/tuyacloud/compare/v0.1.2...v0.1.3
[v0.1.2]: https://github.com/yunjuiot/tuyacloud/compare/v0.1.1...v0.1.2
[v0.1.1]: https://github.com/yunjuiot/tuyacloud/compare/v0.1.0...v0.1.1
3 changes: 2 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ func (c *Client) Parse(res *http.Response, resp interface{}) error {
return err
}
if !body.Success {
// compensation mechanism for refresh token
// compensation mechanism for token invalid.
// e.g. tuya restarts its server all token will expires right now.
if body.Code == 1010 || body.Code == 1011 {
c.lock.Lock()
c.storage.Refresh(c)
Expand Down

0 comments on commit 977c03f

Please sign in to comment.