diff --git a/db/db.go b/db/db.go index c47e6e1..22d0e63 100644 --- a/db/db.go +++ b/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, diff --git a/reflector/stats.go b/reflector/stats.go index 10cfce4..59a3f12 100644 --- a/reflector/stats.go +++ b/reflector/stats.go @@ -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 }