mirror of
https://github.com/LBRYFoundation/reflector.go.git
synced 2025-08-23 09:17:24 +00:00
more common errors
This commit is contained in:
parent
747a6ec2b2
commit
686ac662cc
2 changed files with 6 additions and 0 deletions
2
db/db.go
2
db/db.go
|
@ -416,6 +416,8 @@ func execTx(tx *sql.Tx, query string, args ...interface{}) error {
|
||||||
|
|
||||||
/* SQL schema
|
/* SQL schema
|
||||||
|
|
||||||
|
in prod, set tx_isolation to READ-COMMITTED to improve db performance
|
||||||
|
|
||||||
CREATE TABLE blob_ (
|
CREATE TABLE blob_ (
|
||||||
hash char(96) NOT NULL,
|
hash char(96) NOT NULL,
|
||||||
is_stored TINYINT(1) NOT NULL DEFAULT 0,
|
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"
|
name = "i/o timeout"
|
||||||
} else if strings.Contains(err.Error(), "read: connection reset by peer") {
|
} else if strings.Contains(err.Error(), "read: connection reset by peer") {
|
||||||
name = "read conn reset"
|
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 {
|
} else {
|
||||||
shouldLog = true
|
shouldLog = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue