Skip to content

Commit

Permalink
fix: Make sure fetch benchmark triggers all paths
Browse files Browse the repository at this point in the history
  • Loading branch information
LBeernaertProton committed Sep 21, 2022
1 parent 47a7565 commit b136510
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions benchmarks/gluon_bench/imap_benchmarks/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,26 @@ func (f *Fetch) TearDown(ctx context.Context, addr net.Addr) error {
}

func (f *Fetch) Run(ctx context.Context, addr net.Addr) error {
attributes := []imap.FetchItem{
imap.FetchFlags,
imap.FetchRFC822Size,
imap.FetchRFC822Header,
imap.FetchInternalDate,
imap.FetchRFC822,
imap.FetchRFC822Text,
imap.FetchBody,
"BODY[]",
}

RunParallelClientsWithMailbox(addr, f.MBoxes[0], *fetchReadOnly, func(cl *client.Client, index uint) {
var fetchFn func(*client.Client, *imap.SeqSet) error
if *flags.IMAPUIDMode {
fetchFn = func(cl *client.Client, set *imap.SeqSet) error {
return UIDFetchMessage(cl, set, imap.FetchAll)
return UIDFetchMessage(cl, set, attributes...)
}
} else {
fetchFn = func(cl *client.Client, set *imap.SeqSet) error {
return FetchMessage(cl, set, imap.FetchAll)
return FetchMessage(cl, set, attributes...)
}
}

Expand Down

0 comments on commit b136510

Please sign in to comment.