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 {
|
for {
|
||||||
b, ok := <-jsonIn
|
b, ok := <-jsonIn
|
||||||
var tse TipSetExec
|
|
||||||
|
|
||||||
json.Unmarshal(b, &tse)
|
|
||||||
if !ok {
|
if !ok {
|
||||||
results <- result{
|
results <- result{
|
||||||
totalTime: totalTime,
|
totalTime: totalTime,
|
||||||
@ -333,6 +330,13 @@ var importAnalyzeCmd = &cli.Command{
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var tse TipSetExec
|
||||||
|
err := json.Unmarshal(b, &tse)
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("error unmarshaling tipset: %+v", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
totalTime += tse.Duration
|
totalTime += tse.Duration
|
||||||
for _, inv := range tse.Trace {
|
for _, inv := range tse.Trace {
|
||||||
if inv.Duration > leastExpensiveInvoc {
|
if inv.Duration > leastExpensiveInvoc {
|
||||||
|
Loading…
Reference in New Issue
Block a user