Fix error handling of json
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
a2fd0aad41
commit
9cd34509ee
@ -321,9 +321,6 @@ var importAnalyzeCmd = &cli.Command{
|
||||
|
||||
for {
|
||||
b, ok := <-jsonIn
|
||||
var tse TipSetExec
|
||||
|
||||
json.Unmarshal(b, &tse)
|
||||
if !ok {
|
||||
results <- result{
|
||||
totalTime: totalTime,
|
||||
@ -333,6 +330,13 @@ var importAnalyzeCmd = &cli.Command{
|
||||
return
|
||||
}
|
||||
|
||||
var tse TipSetExec
|
||||
err := json.Unmarshal(b, &tse)
|
||||
if err != nil {
|
||||
log.Warnf("error unmarshaling tipset: %+v", err)
|
||||
continue
|
||||
}
|
||||
|
||||
totalTime += tse.Duration
|
||||
for _, inv := range tse.Trace {
|
||||
if inv.Duration > leastExpensiveInvoc {
|
||||
|
Loading…
Reference in New Issue
Block a user