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

A task to search and report TODOs associated with closed issues #9182

Merged
merged 3 commits into from
May 10, 2017

Conversation

dvoytenko
Copy link
Contributor

No description provided.

if (issueCache[issueId] !== undefined) {
return Promise.resolve(issueCache[issueId]);
}
return githubRequest('/issues/' + issueId).then(response => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This'll make multiple requests to Github. Instead, you could cache this promise (instead of its resoled value).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

var GITHUB_ACCESS_TOKEN = process.env.GITHUB_ACCESS_TOKEN;

/** @type {!Object<string, !Promise<number>>} */
var issueCache = {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object.create

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@erwinmombay
Copy link
Member

@dvoytenko
Copy link
Contributor Author

@erwinmombay Added to DEVELOPMENT.md

@dvoytenko dvoytenko merged commit e4d7efa into ampproject:master May 10, 2017
@dvoytenko dvoytenko deleted the todos3-clean branch May 10, 2017 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants