Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor [github] token persistence, again #1906

Merged
merged 8 commits into from
Aug 19, 2018
Merged
Prev Previous commit
Next Next commit
Send errors to Sentry
  • Loading branch information
paulmelnikow committed Aug 17, 2018
commit e471b43106ac6f5a49dd6340181f85dcf17f83f5
7 changes: 3 additions & 4 deletions lib/token-persistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const fsos = require('fsos')
const githubAuth = require('./github-auth')
const log = require('./log')

// This is currently bound to the legacy github auth code. That will be
// replaced with a dependency-injected token provider.
Expand Down Expand Up @@ -40,17 +41,15 @@ class TokenPersistence {
try {
await this.save()
} catch (e) {
console.error(e)
// TODO send to sentry
log.error(e)
}
}

async noteTokenRemoved(token) {
try {
await this.save()
} catch (e) {
console.error(e)
// TODO send to sentry
log.error(e)
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions services/github/github-constellation.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ class GithubConstellation {
try {
await this.persistence.initialize()
} catch (e) {
// TODO Send to sentry.
console.error(e)
log.error(e)
}

githubAuth.emitter.on('token-added', this.persistence.noteTokenAdded)
Expand Down