Fix bug in shardNum calculation (#910)

Co-authored-by: Azeem Shaikh <azeems@google.com>
This commit is contained in:
Azeem Shaikh 2021-08-25 12:08:03 -07:00 committed by GitHub
parent 2d65ab4f0c
commit 1c7c1e3c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,6 +75,9 @@ func publishToRepoRequestTopic(ctx context.Context, iter data.Iterator, datetime
if err := topicPublisher.Publish(&request); err != nil {
return shardNum, fmt.Errorf("error running topicPublisher.Publish: %w", err)
}
} else {
// shardNum incremented for an empty shard, decrement.
shardNum--
}
if err := topicPublisher.Close(); err != nil {