Skip to content

Commit

Permalink
discovery: Price check
Browse files Browse the repository at this point in the history
  • Loading branch information
yondonfu committed Mar 25, 2021
1 parent 2c9f922 commit 5c3c4f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions discovery/db_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package discovery

import (
"context"
"errors"
"fmt"
"math/big"
"net/url"
Expand Down Expand Up @@ -255,6 +256,10 @@ func (dbo *DBOrchestratorPoolCache) cacheDBOrchs() error {
errc <- err
return
}
if info.PriceInfo == nil || info.PriceInfo.GetPixelsPerUnit() <= 0 {
errc <- errors.New("invalid price from orchestrator")

This comment has been minimized.

Copy link
@iameli

iameli Mar 25, 2021

Member

It's really hard to tell which orch had the problem, add to log message?

return
}
dbOrch.PricePerPixel, err = common.PriceToFixed(big.NewRat(info.PriceInfo.GetPricePerUnit(), info.PriceInfo.GetPixelsPerUnit()))
if err != nil {
errc <- err
Expand Down

0 comments on commit 5c3c4f3

Please sign in to comment.