Skip to content

Commit

Permalink
doc: add some TODOs
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Bezzubov <[email protected]>
  • Loading branch information
bzz committed Dec 11, 2019
1 parent fdad609 commit 610806d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions gmailutils/gmail.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func Fetch(ctx context.Context, srv *gmail.Service, user, query string) ([]*gmai
}

// QueryMessages returns the all messages, matching a query for a given user.
// TODO(bzz): rename to query+fetch, merge better loggin from subject branch
func QueryMessages(ctx context.Context, srv *gmail.Service, user, query string) ([]*gmail.Message, error) {
var messages []*gmail.Message
page := 0 // iterate pages
Expand Down
2 changes: 2 additions & 0 deletions papers/papers.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func SortedKeys(m map[Paper]int) []Paper {
}

// ExtractPapersFromMsgs parses the messages payloads and creates Papers.
// TODO(bzz): rename to extract+aggregate
func ExtractPapersFromMsgs(messages []*gmail.Message) (int, int, map[Paper]int) {
errCount := 0
titlesCount := 0
Expand All @@ -73,6 +74,7 @@ func ExtractPapersFromMsgs(messages []*gmail.Message) (int, int, map[Paper]int)
continue
}

// aggregate
titlesCount += len(papers)
for _, paper := range papers { // map title to uniqTitles
uniqTitles[paper]++
Expand Down

0 comments on commit 610806d

Please sign in to comment.