Skip to content

Commit

Permalink
Apply a workaround to solve slow reading from GRPC.
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrm50 committed Dec 1, 2023
1 parent 15eb71e commit da66dac
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions components/faucet/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,17 @@ func run() error {
consumedOutputs[output.OutputID] = types.Void

Check failure on line 309 in components/faucet/component.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/faucet/component.go#L309

components/faucet/component.go:309: Line contains TODO/BUG/FIXME: "TODO: replace this workaround for slow r..." (godox)
Raw output
components/faucet/component.go:309: components/faucet/component.go:309: Line contains TODO/BUG/FIXME: "TODO: replace this workaround for slow r..." (godox)
			// TODO: replace this workaround for slow reading with a proper solution
}

Check failure on line 310 in components/faucet/component.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/faucet/component.go#L310

Error return value of `deps.Faucet.ApplyAcceptedTransaction` is not checked (errcheck)
Raw output
components/faucet/component.go:310:43: Error return value of `deps.Faucet.ApplyAcceptedTransaction` is not checked (errcheck)
			go deps.Faucet.ApplyAcceptedTransaction(createdOutputs, consumedOutputs)
			                                       ^

err := deps.Faucet.ApplyAcceptedTransaction(createdOutputs, consumedOutputs)
if err != nil {
deps.ShutdownHandler.SelfShutdown(fmt.Sprintf("faucet plugin hit a critical error while applying new accepted transaction: %s", err.Error()), true)
}
// TODO: replace this workaround for slow reading with a proper solution
go deps.Faucet.ApplyAcceptedTransaction(createdOutputs, consumedOutputs)

Check failure on line 314 in components/faucet/component.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/faucet/component.go#L314

commentFormatting: put a space between `//` and comment text (gocritic)
Raw output
components/faucet/component.go:314:4: commentFormatting: put a space between `//` and comment text (gocritic)
			//err := deps.Faucet.ApplyAcceptedTransaction(createdOutputs, consumedOutputs)
			^
return nil

return err
//err := deps.Faucet.ApplyAcceptedTransaction(createdOutputs, consumedOutputs)
//if err != nil {
// deps.ShutdownHandler.SelfShutdown(fmt.Sprintf("faucet plugin hit a critical error while applying new accepted transaction: %s", err.Error()), true)
//}
//
//return err
}); err != nil {
deps.ShutdownHandler.SelfShutdown(fmt.Sprintf("Listening to AcceptedTransactions failed, error: %s", err), false)
}
Expand Down

0 comments on commit da66dac

Please sign in to comment.