more common errors
This commit is contained in:
parent
747a6ec2b2
commit
686ac662cc
2
db/db.go
2
db/db.go
|
@ -416,6 +416,8 @@ func execTx(tx *sql.Tx, query string, args ...interface{}) error {
|
|||
|
||||
/* SQL schema
|
||||
|
||||
in prod, set tx_isolation to READ-COMMITTED to improve db performance
|
||||
|
||||
CREATE TABLE blob_ (
|
||||
hash char(96) NOT NULL,
|
||||
is_stored TINYINT(1) NOT NULL DEFAULT 0,
|
||||
|
|
|
@ -69,6 +69,10 @@ func (s *stats) AddError(e error) (shouldLog bool) { // shouldLog is a hack, but
|
|||
name = "i/o timeout"
|
||||
} else if strings.Contains(err.Error(), "read: connection reset by peer") {
|
||||
name = "read conn reset"
|
||||
} else if strings.Contains(err.Error(), "unexpected EOF") {
|
||||
name = "unexpected EOF"
|
||||
} else if strings.Contains(err.Error(), "write: broken pipe") {
|
||||
name = "write broken pipe"
|
||||
} else {
|
||||
shouldLog = true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue