Merge lp://staging/~jamesh/account-polld/account-refresh into lp://staging/~phablet-team/account-polld/trunk
Status: | Merged |
---|---|
Approved by: | Sergio Schvezov |
Approved revision: | 30 |
Merged at revision: | 21 |
Proposed branch: | lp://staging/~jamesh/account-polld/account-refresh |
Merge into: | lp://staging/~phablet-team/account-polld/trunk |
Diff against target: |
868 lines (+306/-123) 18 files modified
accounts/account-watcher.c (+80/-55) accounts/account-watcher.h (+4/-1) accounts/accounts.c (+16/-10) accounts/accounts.go (+47/-14) cmd/account-polld/account_manager.go (+30/-18) cmd/account-polld/main.go (+8/-4) cmd/account-watcher-test/main.go (+6/-2) data/account-polld.application (+5/-11) data/account-polld.service-type (+7/-0) data/facebook-poll.service (+8/-0) data/google-gmail-poll.service (+1/-1) data/twitter-poll.service (+8/-0) debian/rules (+4/-1) plugins/facebook/facebook.go (+3/-0) plugins/facebook/facebook_test.go (+25/-5) plugins/plugins.go (+9/-1) plugins/twitter/twitter.go (+12/-0) plugins/twitter/twitter_test.go (+33/-0) |
To merge this branch: | bzr merge lp://staging/~jamesh/account-polld/account-refresh |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sergio Schvezov | Approve | ||
PS Jenkins bot | continuous-integration | Approve | |
Review via email: mp+227759@code.staging.launchpad.net |
Commit message
Add support for handling token expiry.
Description of the change
Add support for handling token expiry. The basic mechanism is that:
1. plugins convert their "expired token" errors into the plugins.
2. the AccountManager handles this error by calling watcher.
3. the new token is returned via the watcher's channel, as with other changes.
Along the way, I made a few changes:
* the accounts package now exposes a Watcher object holding the channel. This was so I'd have somewhere to hang the Refresh() method.
* I replaced the AccountManager's terminate channel with a channel for receiving the AuthData. Closing this channel is used as a terminate signal, and removed the need for a mutex.
Looks good, just added one minor inline comment.
Another non related to this change comment is to ask if it would be ok to change the fprintf's to call go's log.Print.*