-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
network service cleanup #560
Conversation
- cleanup sql db logs Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
@@ -20,28 +20,30 @@ import ( | |||
|
|||
var logger = flogging.MustGetLogger("token-sdk.sql") | |||
|
|||
func initSchema(db *sql.DB, schemas ...string) error { | |||
func initSchema(db *sql.DB, schemas ...string) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you always return the error, you don't have to declare the result var in the signature.
@@ -243,33 +243,35 @@ func (db *TransactionDB) AddTransaction(r *driver.TransactionRecord) error { | |||
return err | |||
} | |||
|
|||
func (db *TransactionDB) SetStatus(txID string, status driver.TxStatus) error { | |||
func (db *TransactionDB) SetStatus(txID string, status driver.TxStatus) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here for err.
@@ -354,7 +356,7 @@ func (db *TransactionDB) QueryValidations(params driver.QueryValidationRecordsPa | |||
return &ValidationRecordsIterator{txs: rows, filter: params.Filter}, nil | |||
} | |||
|
|||
func (db *TransactionDB) AddTransactionEndorsementAck(txID string, endorser view.Identity, sigma []byte) error { | |||
func (db *TransactionDB) AddTransactionEndorsementAck(txID string, endorser view.Identity, sigma []byte) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
if !tm.Exists(TokenRequestMetadata) { | ||
func (a *TransactionInfoProvider) loadTransient(trRaw []byte, txID string) (map[string][]byte, error) { | ||
if len(trRaw) == 0 { | ||
if logger.IsEnabledFor(zapcore.DebugLevel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to make the check isEnabledFor unless you have any calculations to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo comments
This PR proposes the following: